Skip to main content

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.

Loyalty API

Handle points, rewards, tier management, and redemption.

Campaign API

Create and manage marketing campaigns, promotions, and participant tracking.

Analytics API

Access analytics data, reports, and business intelligence.

Booking API

Manage bookings, reservations, and venue management.

Notification API

Send notifications and manage notification 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 allowed
  • X-RateLimit-Remaining - Remaining requests
  • X-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 - Success
  • 201 Created - Resource created
  • 400 Bad Request - Invalid request
  • 401 Unauthorized - Authentication required
  • 403 Forbidden - Insufficient permissions
  • 404 Not Found - Resource not found
  • 429 Too Many Requests - Rate limit exceeded
  • 500 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.