Webhook
Webhooks allow you to receive Push API messages to your own REST endpoints. You only need to provide the URL and Authorization and we start pushing selected messages towards your endpoint.
Authorization
Webhook uses Authorization
header to authenticate requests towards your endpoint. You can implement authorization on your end as you see best fit using this header. More information about Authorization header.
Realtime authorization
Webhook supports realtime authorization of charger sessions. After enabling RealTimeAuth
message type, eMabler will start to send following requests to the URL you have provided:
POST <URL> HTTP/1.1
Host: example.com
Content-Type: application/json
Authorization: <Authorization>
{
"charger_id": "IdOfTheCharger",
"rfid_tag_id": "TAG1234"
}
With this request you can then build custom logic on your end to handle charger session authorizations. Based on the response you send to this request, eMabler will the propagate the result to the charger which will then either approve or reject charging.
eMabler expects following response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"charging_allowed": true, // boolean
"rfid_tag_type": "", // not mandatory field can be additional info like, TAG, VIN, etc.
"reason": "UNKNOWN_CHARGER_ID" | "UNKNOWN_RFID_TAG_ID" | "EXPIRED_RFID_TAG_ID" | "UNAUTHORIZED_RFID_TAG_ID" // if not allowed, why?
}
You can also configure the fallback result in case the request fails (should the sessions be authorized by default?) and the timeout in seconds.
The realtime authorization also works with OCPI-integrated chargers. If the charger is OCPI-integrated and it has the realtime authorization enabled, the realtime authorization endpoint is first queried, but if the endpoint does not allow charging, then additionally the OCPI tokens are checked too.