Creating a webhook

Creating a webhook is extremely easy in our EverTransit system. For the purpose of this tutorial, we are going to create a webhook that listens for the creation of a ride. Follow the steps below.

Step 1. Go to the developer's section located on the new dispatch website and click on the Webhooks card.

Step 2. To add a new webhook, click on the Add Webhook button. Note that you need to have the EverTransit API feature enabled. If you haven't already enabled it, click here.

Step 3. Fill in the information in the necessary fields.

Endpoint URL

The endpoint URL is the URL of the server that will receive the webhook POST requests.

Since we're developing locally for our tutorial, we'll set it to the https://*.ngrok.io URL, followed by /webhook. For example, https://9a6b-84-126-144-149.ngrok.io/webhook.

Secret

Setting a webhook secret allows you to ensure that POST requests sent to the endpoint URL are from EverTransit. When you set a secret, you'll receive the Webhook-Signature header in the webhook POST request. For more information on how to use a secret with a signature header to secure your webhook payloads, see Securing your webhooks.

In order for EverTransit to allow us to create a webhook, you must enter a value in this field. Make a note of this value. We'll use it to set up our webhook.

Description

This input is used to describe your webhook.

Selecting the events

Events are our way of letting you know when something interesting happens in your fleet. When an event occurs, we create a new Event object. If you registered a webhook endpoint to receive that event, we send it to your endpoint as part of a POST request. For more information about events and all the supported events, consult the section Webhook events.

For now, we are only going to select the event ride.created , which will allow each time a ride is created in your fleet, this event will be notified to you through a POST request to the endpoint that you previously configured.

Once we have reached this point, we just have to click on the Add Webhook button and the webhook will be created.

Enable EverTransit API

Note that you need to have the EverTransit API feature enabled. If you haven't already enabled it, you will see a page like this when you click on the Webhooks button. So you need to contact us to enable this feature for your fleet.

Last updated