API Tokens
An API token lets your system call the Exolink API for one tenant without a user login. Exolink issues it for you, and it is:
- bound to one tenant: requests for any other tenant are refused,
- limited to the chargers it was issued for: the list leaves out every other charger of the tenant, and an action sent to one of them answers
404, - limited to the charger actions it was issued for, for example only
Reset, - valid until a fixed expiry date, after which it is refused.
A token starts with exo_ and is 40 characters long.
To get a token, or to change or revoke one, contact Exolink.
Sending the token
Section titled “Sending the token”Send the token in the Authorization header of every request:
Authorization: Bearer exo_…A token can call two endpoints:
| Endpoint | Purpose |
|---|---|
GET /tenant/{tenantId}/charger |
Find a charger by its identity, to get its id |
PATCH /tenant/{tenantId}/charger/{chargerId} |
Send an action the token is allowed |
{tenantId} is the tenant’s domain prefix, which Exolink sends you with the token.
Example: reset a charger
Section titled “Example: reset a charger”The action endpoint takes Exolink’s numeric charger id, not the charger’s OCPP identity. Look the id up by the identity, spelled exactly as the charger is registered (the match is case-sensitive):
curl https://api.exolink.cloud/tenant/{tenantId}/charger \ -H "Authorization: Bearer $EXOLINK_TOKEN" \ -H 'x-exo-filter: ["eq","identity","CP-0001"]' \ -H 'x-exo-fields: ["id","identity"]'[ { "id": 4711, "identity": "CP-0001", "chargerConnected": true, "cpmsConnected": true, "connectedCpmsIds": [ 12 ], "__total": 1 }]Act only if the response holds exactly one charger and its identity is the one you asked for: a filter that is not valid JSON is ignored, and the response then lists every charger the token reaches. To look up several chargers at once, use ["in","identity",["CP-0001","CP-0002"]]. The id stays the same as long as the charger is registered, so you can store it.
Then send the reset. type is Soft (the default) or Hard. For an OCPP 2.0.1 charger, add "protocol": "ocpp2.0.1" and use OnIdle (the default) or Immediate:
curl -X PATCH https://api.exolink.cloud/tenant/{tenantId}/charger/4711 \ -H "Authorization: Bearer $EXOLINK_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "action": "Reset", "data": { "type": "Soft" } }'A 200 response means the charger was sent the reset. It does not wait for the charger to restart.
Error responses
Section titled “Error responses”| Status | Meaning |
|---|---|
400 |
The request body is not valid, for example it has no action. |
401 |
No Authorization header was sent. |
403 |
The token is malformed, expired or revoked, the request is for another tenant, the endpoint or action is not granted to the token, or the charger is blocked by Exolink. |
404 |
The tenant has no charger with this id, or the token was not issued for it. |
406 |
Reset refused: a connector is charging. Retry once the session has ended. |
417 |
The charger is not connected to Exolink right now. |
429 |
Too many requests. Wait a few minutes before retrying. |