Create a Developer Portal account and generate your API key in the portal. Send a POST request to /authenticates with your key in the Authorization header. The response holds a bearer token. The token lasts 1 hour. Send it in the Authorization header on every other API route.
The bearer token is a JSON Web Token. Read an introduction to JSON Web Tokens or find libraries for working with them.
A request without a valid token returns a 401 status code.
This is an example request to /authenticates.
curl --request POST \
--url https://nexhealth.info/authenticates \
--header 'Nex-Api-Version: v3.0.0' \
--header 'Authorization: YOUR_API_KEY'A successful response holds a bearer token.
{
"code": true,
"description": "Authenticated",
"error": null,
"data": {
"token": "YOUR_BEARER_TOKEN"
},
"count": null
}
Using bearer tokensPut the string "Bearer" in front of the token in your
Authorizationheader, as shown below.
--header 'Authorization: Bearer YOUR_BEARER_TOKEN'