Event callback API
When an event is finished outside of Clougistic, it's possible to call a following webhook. Use the Clougistic Event Callback API when you want to use one of our micro services (SFTP, FTP, Print).
For example if a label is printed by the forwarder it's possible to send trackingnumbers to your e-commerce system with the help of the webhook function.
Method: POST
Resource: /api/v1/event/fire
Headers: X-Event-Name
Example
Headers
X-Event-Name : dhl.labels.created
Payload
{ "access_key": "[Clougistic API access key]","entity_id": "ENTITY_ID", "payload": {"reference": "000000032","trackingcodes":[ "12345678", "12345679", "12345680" ] } }
In this example, the webhook that should deliver the payload must listen to event: dhl.labels.created
The keys defined in the "payload" section of the event can be used as variables in the payload section of a webhook. In the example above:
"reference" can be used as: {{$reference}}
"trackingcodes" can be iterated over as follows: {{for $track in $trackingcodes}} {{$track}} {{next track}}