API documentation
Step 1 – Basic check
One request that confirms your token and your connection to the API are correct.
Before you go further, make sure your system talks to the API correctly. The check endpoint authenticates your token exactly like every other endpoint does: if the check passes, your token is correct.
curl https://provider-staging.flexy.gr/api/v1/health/auth/ \
-H "Authorization: Bearer <token>"
Replace <token> with the staging token shown on your partner page.
Everything is correct
The API answers with HTTP 200:
{
"health": {
"status": "ok",
"environment": "staging",
"client": {
"name": "Default API Key"
}
}
}
| Field | Meaning |
|---|---|
status | Always ok: your token was accepted. |
environment | The environment that answered. For your tests it must be staging. |
client.name | The API key the token belongs to. |
Something is wrong
Errors follow the error format. Find the row with the HTTP status and the
errors[0].code you received:
| HTTP | code | Cause | What to do |
|---|---|---|---|
401 | not_authenticated | The request sent no token. | Send the header Authorization: Bearer <token>. |
401 | token_not_valid | The token was not recognised: it was not copied in full, it belongs to another environment, or the key has been deactivated. | Copy the staging token again and call the staging URL. |
401 | authentication_failed | With detail equal to API call quota exceeded: your account has no calls left. | Email us at [email protected]. |
403 | permission_denied | You sent a user login token instead of the API token. | Use the API token we sent you. |
301 | — | The URL does not end with /, so the answer is a redirect with no body. | Call /api/v1/health/auth/ with the trailing slash. |
Once you get 200, your connection is ready. Continue with step 2.