How To Setup Webhooks In Detrack – V2

Webhook PUSH notifications is a HTTP callback, i.e. this feature is for Detrack to POST a notification to the specified Webhook URL whenever there is a status update for the job.

This feature is used in the integration process to send information to your downstream third-party applications / systems.

Our PUSH notification will be posted from the I.P. addresses below. If necessary, kindly whitelist these I.P. addresses.

  • 44.236.78.196
  • 44.228.138.42
  • 52.13.202.33

List of available Triggers for sending the Webhook notifications.

Trigger Description
In Transit New job is added, with the primary status set to “In Transit”.
Info Received New job is added, with the primary status set to “Info Received”.
Scheduled Tracking widget status changed to “Scheduled”. When the job has an assigned driver, and that date of the job is of a future date.
In Progress Occurs when the job has an assigned driver, and is of the current date.
Heading To Driver tap “Head To Location” on Driver App.
Partially Completed The job is partially completed, i.e. the job has at least 1 item being rejected in the Item Details.
Failed The job is not completed.
Return The job is set to the “Returned” status.
On Hold The job is set to the “On Hold” status.
Deleted When the job is “Deleted”.

To receive the webhook notification, you will need a small web application that can accept the HTTP requests by adding a webhook URL to your application.

Example frameworks of server-side programming languages:

Language Framework
C#
  1. ASP.NET MVC
Java
  1. Servlets
  2. Spark
Node.js
  1. Express
Python
  1. Django
  2. Flask
Ruby
  1. Rails
  2. Sinatra
PHP
  1. Laravel
  2. Symfony
  3. Yii

For more information on the payload of the PUSH notifications, kindly refer to:

To set up the webhook for both Delivery and Collection jobs,

  1. Navigate to Settings > Webhook.
  1. You may select the required triggers (based on job status) to push the information over to the designated URL.

Basic Auth (Optional)

This section is for users who have a “Basic Auth” being enabled for the webhook URL.

  1. Select “Basic Auth” for “Webhook Auth Type”.
  2. Enter your “Username” and “Password” into the “Username” and “Password” fields respectively.

Alternatively, if you wish to separate the webhooks into Delivery and Collection jobs, you may enter the Webhook URL separately under Delivery or Collection.

  1. Navigate to Settings > Delivery or Collection
  1. You may enter the URL into the field.

Checking Of Webhook Status And Re-POSTing

1. For checking of webhook status, navigate to Settings > Job > Fields.

2. Enable the “Webhook URL” field.

3. Click Save when done.

4. Create a dummy job.

5. Click the icon under the “Webhook Status” column to open a pop-up.

6. You may refer to the various HTTP statuses for troubleshooting, and re-post the PUSH notification by clicking on the icon under the “Repost” column.

HTTP Status Codes

HTTP Status Code Description
2xx OK.
3xx Redirect.
4xx Client Error Response.
5xx Server Error Response.