Response body

Code field

Every Synchronizer API response has a boolean field named code. It is true or false.

  • false means the request failed. The response includes an error message.
  • true means 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.

TypeSample nameSample valueSample JSON
stringname"Dr. Sarah Lexington"{"name":"Dr. Sarah Lexington"}
integerlocation_id148{"location_id":148}
floatlatitude38.8976633{"latitude":38.8976633}
booleaninactivefalse{"inactive":false}
datetimeupdated_at"2020-08-12T22:42:21.444Z"{"updated_at":"2020-08-12T22:42:21.444Z"}
nullnpinull{"npi":null}
📘

DateTime format

All DateTime values from the API use the format yyyy-MM-ddTHH:mm:ssZ. The Z means the time zone is UTC.

Example: "2020-08-12T22:42:21.444Z"

ChangelogMCP serverErrorsdevelopers@nexhealth.com