Skip to content

API Response Guide

Response Structure

Our standardized response ensures consistent API communication:

json
{
    "status": 200,
    "message": "Operation successful",
    "timestamp": "2024-11-21T12:34:56Z",
    "data": { ... }
}

Response Properties

PropertyTypeDescriptionExample
statusnumberHTTP/Custom response status code200, 403
messagestringAdditional information on response status"Operation successful"
timestampdatetimeResponse generation time"2024-11-20T12:34:56Z"
dataanyRequested resource/result{ "user": { ... } }

Status Code Classifications

Standard HTTP Status Codes

CategoryRangeMeaningCommon Codes
Success2xxRequest processed successfully200
Client Errors4xxClient-side issues400, 401, 403, 404, 22
Server Errors5xxServer-side problems500, 503

Custom Error Codes

Authentication & Authorization

CodeDescription
10Unauthorized access
21Missing session token
413Invalid session token

User & Account Errors

CodeDescription
12Reserved username
13Username duplicate
1001Invalid account settings
1002Unsupported currency

System & Infrastructure Errors

CodeDescription
800Cache error
900Upstream service failure
910Downstream service issue
960Decoding error
1000Retry-able general error

Troubleshooting and Reporting

  1. Check Status Code
  • Do not assume success. Always check the status code.
  • Use the status field for error handling.
  • Ping the system status page. Outlined at Check Status.
  1. Use Timestamp for Debugging
  • Log response timestamps - used for tracing the request lifecycle.
  • Report any discrepancies to the support team.