In this article, you will learn about using Onfleet's webhooks. To view Onfleet's API and Webhook documentation please go here.
Webhooks Set- up & 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 manage or create webhooks from the Onfleet dashboard, start by logging in as the admin user. Select the "Settings" icon on the upper-right corner of the dashboard, then click on "API & Webhooks" from the settings window.
To create a new webhook:
1. Click the "+" button located on the bottom right corner of the "Webhooks" box.
2. (optional) Label the webhook with a distinctive name.
3. Select which trigger you would like for your webhook.
4. Enter the URL where webhooks updates should be pushed
5. Validate and create the webhook.
Webhook 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; you can refer to 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.
Webhook 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".
For more information on Webhook authentication please go here.
Scoped Webhooks
A Scoped Webhook is a webhook created using a Scoped API key.
If your organization currently integrates with another software to create or track your Onfleet tasks, you can use a Scoped API key to create a Webhook that would limit the access of an integrator to your organization's task information. You can find more information on how to use a Scoped API Key to create a Scoped Webhook by going to our API Documentation.