V6RESTful APIs - Event Subscription
The event subscription (event call back) APIs allow another systems to receive a web call back when certain events happen on their consigments. It is mainly used for receiving stage update information.
Subscribe to consignment stage update
​
Since: 20210301
This API is to register a 'web hooks' (a link that can be triggered by v6) when a consignment stage is updated in v6. V6 will subtitue the {connoteNos} in the url with list of connotes that have stage updated (please note: if multiple connotes have stages updated at the same time, v6 will combine the consignment numbers into a list, separated by comma, to trigger the other system's url once only)
V6 only notifies the other system that the stages (of these connotes) have been updated but it does not provide the actual stage along with the call. It is totally up to the other system to later call v6 API to get the tracking info, get stage update , or do anything with the notication as its business logic requires. Also, if the other system is not accessible at the time of the event, v6 will abort the call and will NOT attempt to re-trigger the URL.
​
POST: /v6-api/rest/eventSubscriptions/consignments/stage
​
Request Payload:
{
"systemName": "exampleSystem",//the other system name
"url": "https://www.example.com/callback?s={connoteNos}", //the url the other system provides to v6 for calling back, this url must have {connoteNos} placeholder
"authHeader": "xxx",//authorization header v6 will send a long with the request to url
"customer": "xxxx",//the account code in v6
}
Response Payload:
{
"id": "...",//subscription Id
"message":"..."//additional message
}
Unsubscribe from consignment stage update
This API is to de-register a 'web hooks' previously registered. This will stop v6 from triggering the url
​
Since: 20210301
​
DELETE: /v6-api/rest/eventSubscriptions/consignments/stage/{id}
​
Path parameter:
id: the ID returned by v6 from subscription API
List subscriptions of consignment stage update
This API is to list all 'web hooks' previously registered.
​
Since: 20210301
​
GET: /v6-api/rest/eventSubscriptions/consignments/stage
​
Response payload:
{
"data":[
{"id":,//subscription Id
"url":,
"authHeader":
"systemName":
"customer":
},...
]
}