The authenticates endpoint returns a bearer token. You need the token to call every other API endpoint. Tokens expire after 1 hour.
NexHealth bearer tokens are JSON Web Tokens. Read the introduction to JSON Web Tokens and find libraries for working with them.
To get a bearer token, send a request like this:
curl --request POST \
--url https://nexhealth.info/authenticates \
--header 'Nex-Api-Version: v3.0.0' \
--header 'Authorization: YOUR_API_KEY'A successful request returns a bearer token in the response body:
{
"code": true,
"description": "Authenticated",
"error": null,
"data": {
"token": "YOUR_BEARER_TOKEN"
},
"count": null
}
Using bearer tokensOnce you have a bearer token, add the string "Bearer" before it in your
Authorizationheader, as shown below.
--header 'Authorization: Bearer YOUR_BEARER_TOKEN'