It is possible to register a webhook or callback so that you can be notified when an ASN (Advanced Shipping Notice) has been booked or partially booked. This saves the need to poll the API for updates. To do this after creating an ASN you will need to add a Connect action. This can be done using /api/ASN/{id}/ConnectActions.
Example
{ "Type": "API", "SourceASNId": "PO-12453", "Complete": false, "ExtraCode1": "https://api.yoursystem.com/callback/ASNBookedIn", "ExtraCode2": "", // Future Use "ExtraCode3": "", // Future Use "ExtraCode4": "Basic dXNlcm5hbWU6cGFzc3dvcmQ=" // Auth Header Option - See Below }
SourceASNId: The ASN ID in the system that the ASNcame from.
ExtraCode1: The URL to call when the ASN has been booked in.
ExtraCode2: Future Use.
ExtraCode3: Future Use.
ExtraCode4: Auth Header Option - See Additional Security Options below.
You will then get a POST request back to the specified address upon despatch with the same ASN Json found on this call: /api/ASN/{id}.
Additional Security Options
When making the webhook calls you could provide an API key in the URL to verify where it's come from.
β
Example: https://api.yoursystem.com/callback/ASNBookIN?APIKEY=fe14830f-0980-46c6-a540-04c20a26b01c.
β
Alternatively, we can provide a dedicated value in the Authorization header. This will be taken from ExtraCode4. So, if the Webhook handler was secured by Basic Auth you could supply that value in the ExtraCode4 to be used in the Authorization header.
username password then becomes username: password
Base64 encoded = dXNlcm5hbWU6cGFzc3dvcmQ=
Example
{ "ExtraCode4": "Basic dXNlcm5hbWU6cGFzc3dvcmQ=" }