Webhook Setup for Visibility and Invoice

On this page the steps to setup a webhook for DSV Visibility and Invoice are explained.

A webhook is a reverse API, that proactively sends the Visibility/ invoice data to to the designated endpoint.

When you activate the webhook for invoice and Visibility you will receive data on all the MDM numbers, which are associated with your API user.

Upon activation of the webhook for invoice and Visibility, you will receive data pertaining to all MDM numbers associated with your API user.

Invoice Webhook

POST URL: https://api.dsv.com/my/invoicedemo/v1/invoices/subscribe

Specify the Push URL: Provided the URL where you want the data to be delivered.

AuthenticationData: We only accept Basic authentication (username and password)

Replace "test-user" with your actual username and "test-password" with your real password.

Headers: Include any necessary headers. Make sure these headers match the requirements of the system receiving the webhook.

Test the Webhook: After setting up the webhook, test it to ensure it's functioning as expected. Trigger the event that the webhook is subscribed to and verify that the Data is delivered to the specified URL with the correct authentication and headers.

{

"pushUrl": "http://localhost:20846/WeatherForecast",
"authenticationData": {
"type": "basic ",
"username": "test-user",
"password": "test-password"
},
"headers": [
{
"name": "TestHeader",
"value": "TestHeaderValue"
},
{
"name": "TestHeader1",
"value": "TestHeaderValue1"
}
]
}

Visibility Webhook

URL: https://api.dsv.com/my/visibilitydemo/v1/shipments/subscribe/{subscriptionEvent}

subscriptionEvent

Include the event you want to subscribe to SubscribeToDeviceReadings or SubscribeToDeliveryReceipt. Only subscribe to one event at a time. 

Specify the Push URL: Provided the URL where you want the data to be delivered.

AuthenticationData: We only accept Basic authentication (username and password.)

Replace "test-user" with your actual username and "test-password" with your real password.

Headers: Include any necessary headers. Make sure these headers match the requirements of the system receiving the webhook.

Test the Webhook: After setting up the webhook, test it to ensure it's functioning as expected. Trigger the event that the webhook is subscribed to and verify that the Data is delivered to the specified URL with the correct authentication and headers.

{

"pushUrl": "http://localhost:20846/WeatherForecast",

"authenticationData": {

"type": "basic ",

"username": "test-user",

"password": "test-password"

},

"headers": [

{

"name": "TestHeader",

"value": "TestHeaderValue"

},

{

"name": "TestHeader1",

"value": "TestHeaderValue1"

}

]

}

Unsubscribe Webhook

Depending on which webhook you want to unsubscribe, post an API call to one of the below URL, using your Basic authentication, await response "200 OK".

Webhook is now unsubscribed.

ShipmentDeliveryReceipt: https://api.dsv.com/my/visibilitydemo/v1/shipments/deliveryReceipt/unsubscribe

SubscribeToDeviceReading: https://api.dsv.com/my/visibilitydemo/v1/shipments/deviceReadings/unsubscribe

Invoice: https://api.dsv.com/my/invoicedemo/v1/invoices/unsubscribe