Webhooks

In this article, you will learn about using Onfleet's webhooks.

This article will cover:

 

 

Onfleet Webhooks & Triggers

Webhooks are an advanced feature that allows organizations to be notified as soon as special trigger conditions are met, via an HTTP POST to the URL specified. 

To view Onfleet's API and Webhook documentation please go here. 

webhooks.gif

Manage or create webhooks from the Onfleet Dashboard, by logging in as the admin user and navigating to the API & Webhooks tab in Settings.

To create a new webhook:

1. Click the + button under Webhooks

Dashboard_Webhook.png

2.  (optional) Label the webhook with a distinctive name

3. Choose from one of 13 webhook triggers:

    • Task started
    • Driver ETA less than or equal to X seconds
    • Driver arriving, at or closer than X meters
    • Task completed
    • Task failed
    • Driver status changed
    • New task created
    • Task updated
    • Task deleted
    • Task assigned
    • Task unassigned
    • Task delay time is greater than or equal to X seconds
    • Task cloned
    • SMS Recipient Response Missed

Dashboard_Webhook.png

4.  Enter the URL where webhooks updates should be pushed

5.  Validate and create the webhook

Back to Top

 

Validation

To ensure ownership of the URL used, Onfleet requires validation before the webhook is enabled.

The URL value provided will receive a GET request from our servers, with a check query parameter. You need to respond to our validation request with exactly this value, untouched, as a simple string response. See the Create a Webhook documentation for code examples. To get started quickly with Onfleet webhooks, feel free to use the webhooks tool from our open-source repository which creates webhook endpoints for you.

Note: Zapier and RequestBin URLs are whitelisted and are automatically validated.

 Back to Top

 

Secrets

As an additional security measure, Onfleet will automatically generate a Webhook secret to ensure the request received by your webhook URL is from Onfleet.  The Webhook secret can be found under the "API & Webhooks" section of the admin settings by selecting "Show Secret".

Webhook_Show_Secrets.png

screenshot-onfleet.com-2020.04.16-14_32_03__1_.png

 

For more information on Webhook authentication please go here.

 

Back to Top