Quick Start
- Use JSON for request and response bodies with
Content-Type: application/json. - Authenticate as required by the API (e.g. sign, or JWT for Issuing endpoints).
- Handle responses using the numeric
codeandmsgfields.
Request Format
Content Type
- Content-Type:
application/json - Request bodies must be valid JSON. Responses are JSON.
Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | application/json |
Authorization | When required | Bearer token (e.g. JWT for Issuing) or as specified per endpoint |
Idempotency-Key header for POST requests. See the endpoint documentation.
Example Request
Response Format
Response Body
All responses use the same structure:- code – Numeric result or error code (e.g. 200 for success).
- msg – Human-readable message (may be localized).
- data – Response payload on success; often
nullon error.
Response Headers
| Header | Description |
|---|---|
x-request-id | Request identifier; include when contacting support |
Content-Type | application/json |
Retry-After | Present on 429; wait time in seconds |
HTTP Status Codes
| Code | Meaning | Action |
|---|---|---|
| 200 | Success | Process response data |
| 201 | Created | Process response data |
| 400 | Bad request | Fix request and retry |
| 401 | Unauthorized | Check credentials/signature |
| 403 | Forbidden | Check permissions |
| 404 | Not found | Verify resource ID |
| 409 | Conflict | Resolve conflict before retry |
| 429 | Rate limited | Wait and retry (see Retry-After) |
| 500 | Server error | Retry with backoff |
| 502/503/504 | Unavailable | Retry after delay |
Error Handling
- Check HTTP status first; treat 4xx and 5xx appropriately.
- Use the numeric code in the body for logic; see Response Codes.
- Log x-request-id when present for support and debugging.
- Retry only on 5xx or 429; fix 4xx requests before retrying.
- Respect Retry-After on 429.