Code field
Every Synchronizer API response has a boolean field named code. It is true or false.
falsemeans the request failed. The response includes an error message.truemeans the request succeeded or was accepted. The response body can still be empty.
Response format
All responses are JSON. The response object has these properties.
code: Boolean. Whether the request succeeded.
description: String or null. A note about the request, such as Patient created successfully or Note that following parameters are ignored: location_id. It is null when there is nothing to say.
error: null when the request succeeded. On a failure, an array with the error messages.
data: The requested data. An object when you request one record, an array when you request a list, null on a failure.
count: Integer or null. On a page-numbered list, the total number of matching records across all pages, so you can tell when to stop paging. On a list without paging, the number of records in data. null for a single record. Cursor-paginated lists return page_info instead and leave count out, except GET /working_hours and GET /patient_recalls, which return both.
page_info: Object. Cursor-paginated lists only. It holds the cursors for the previous and next page. See Pagination.
Parameters the endpoint does not take
A parameter the endpoint does not accept does not fail the request. The API ignores it and says so in description. In the example below, GET /institutions is called with location_id, which it does not take.
Request
curl --request GET 'https://nexhealth.info/institutions?location_id=148' \
--header 'Authorization: Bearer YOUR_BEARER_TOKEN' \
--header 'Nex-Api-Version: v3.0.0'Response
The institution fields are trimmed here.
{
"code": true,
"description": "Note that following parameters are ignored: location_id.",
"error": null,
"data": [
{
"id": 1,
"name": "Demo Practice",
"subdomain": "demo-practice",
"locations": []
}
],
"count": 1
}A failed request looks like this, here a 403 for a subdomain your key cannot reach. See Errors for what each message means.
{
"code": false,
"description": null,
"data": null,
"error": [
"You don't have access to perform this action."
]
}Field types
These are some of the data types API responses return.
| Type | Sample name | Sample value | Sample JSON |
|---|---|---|---|
string | name | "Dr. Sarah Lexington" | {"name":"Dr. Sarah Lexington"} |
integer | location_id | 148 | {"location_id":148} |
float | latitude | 38.8976633 | {"latitude":38.8976633} |
boolean | inactive | false | {"inactive":false} |
datetime | updated_at | "2020-08-12T22:42:21.444Z" | {"updated_at":"2020-08-12T22:42:21.444Z"} |
null | npi | null | {"npi":null} |
DateTime formatAll DateTime values from the API use the format
yyyy-MM-ddTHH:mm:ssZ. TheZmeans the time zone is UTC.Example: "2020-08-12T22:42:21.444Z"