1. Standardized Response
Standardized API response structure for CentriCare services and gateways. Responses must include detailed request status, the returned data payload, and optional metadata.
Definition
| Property | Type | Description |
|---|---|---|
| success | boolean | Indicates whether the API request was processed successfully |
| message | string | A human-readable message summarizing the result of the request or providing error details |
| status_code | string | The application-specific status code or standard HTTP status for request tracking |
| data | array | The primary payload containing the requested list of records |
| metadata.total | number | The total number of items available across all pages for the query |
| metadata.offset | number | The starting index or position from which items are retrieved |
| metadata.limit | number | The maximum number of items returned in a single page |
| metadata.next | string | null | The URL or cursor link to fetch the next page of results, or null if on the last page. |
| metadata.previous | string | null | The URL or cursor link to fetch the previous page of results, or null if on the first page |
Example
{
"success": true,
"message": "Successfully do something",
"status_code": "200",
"data": [],
"metadata": {
"total": 1,
"offset": 0,
"limit": 1,
"next": null,
"previous": null
}
}
Single Resource
For single-resource HTTP requests, the API response follows the standard response schema with fixed default metadata values. The metadata.total property will always be set to 1. Since pagination is not applicable to individual resource retrievals, both metadata.offset and metadata.limit will default to 0, while metadata.next and metadata.previous will strictly return null.
Error Codes
Learn more about how we standardized error status code.