API Reference Overview
Complete API reference documentation for the SBM CRM Platform. All endpoints are RESTful and return JSON responses.
Base URL
https://api.sbmcrm.example.com/v1
Authentication
All API requests require authentication. See the Authentication Guide for details.
Authorization: Bearer YOUR_ACCESS_TOKEN
API Endpoints
Customer API
Manage customer profiles, segmentation, and WeChat integration.
- Customer API Reference - Customer CRUD operations, profile management, segmentation
Loyalty API
Handle points, rewards, tier management, and redemption.
- Loyalty API Reference - Points operations, rewards, tier management
Campaign API
Create and manage marketing campaigns, promotions, and participant tracking.
- Campaign API Reference - Campaign management, participant operations
Analytics API
Access analytics data, reports, and business intelligence.
- Analytics API Reference - Analytics queries, reports, dashboards
Booking API
Manage bookings, reservations, and venue management.
- Booking API Reference - Booking operations, venue management
Notification API
Send notifications and manage notification preferences.
- Notification API Reference - Push notifications, preferences
Common Patterns
Request Format
POST /api/v1/resource
Authorization: Bearer TOKEN
Content-Type: application/json
{
"field1": "value1",
"field2": "value2"
}
Response Format
{
"data": {
"id": "12345",
"name": "Example"
}
}
Error Format
{
"error": {
"code": "ERROR_CODE",
"message": "Error description",
"details": []
}
}
Rate Limiting
- Standard: 1,000 requests/hour
- Premium: 10,000 requests/hour
- Enterprise: Custom limits
Rate limit headers:
X-RateLimit-Limit- Total requests allowedX-RateLimit-Remaining- Remaining requestsX-RateLimit-Reset- Reset timestamp
Pagination
List endpoints support pagination:
GET /api/v1/resource?page=1&limit=20
Response includes pagination metadata:
{
"data": [...],
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"total_pages": 8
}
}
Filtering
Many endpoints support filtering:
GET /api/v1/customers?filter[tier]=gold&filter[status]=active
Sorting
Sort results using the sort parameter:
GET /api/v1/customers?sort=created_at:desc
HTTP Status Codes
200 OK- Success201 Created- Resource created400 Bad Request- Invalid request401 Unauthorized- Authentication required403 Forbidden- Insufficient permissions404 Not Found- Resource not found429 Too Many Requests- Rate limit exceeded500 Internal Server Error- Server error
API Versioning
The API uses URL versioning. Current version is v1. Future versions will be at /v2, /v3, etc.
SDKs
Official SDKs available:
- JavaScript/Node.js:
@sbmcrm/sdk-js - Python:
sbmcrm-python - PHP:
sbmcrm-php
Support
For API support, contact the development team or refer to the Developer Guide.