Zapier allows for easy integration between Onfleet and other useful web applications, making task creation and other Onfleet automations a breeze with very little to no engineering effort.
Webhooks by Zapier is a Zapier step that allows you to capture messages that are sent from an app when something happens. You can then use Webhooks by Zapier as a trigger step to automate other actions, for example: sending a message to the admin email/a Slack channel or saving data to Google Sheets when an Onfleet event happens for archival purposes.
Get Started with Webhooks
- Go to Zapier and attempt to make a zap
- Search for "webhooks" and select "Webhooks by Zapier"
As "Webhooks by Zapier" connects to 1000+ apps, we will only list out a few popular options. Feel free to reach out to Onfleet Support if you wish to explore new possibilities!
Connecting Onfleet to Zapier Webhooks
- Scroll or search for an app that you wish to connect to "Webhooks by Zapier" as an action step. Sample apps to choose from: Slack, Gmail, Google Sheets, Twilio (for phone call and SMS), or a plain simple email.
- Once selected, you will need to setup the catch hook for it to receive a sample webhook data. Zapier will generate an URL for your webhook, this is where Onfleet will send the event updates to. Copy this URL and paste it on your Onfleet settings -> API & Webhooks -> Create a new webhook. Don't click on "OK, I did this" just yet, we will cover this part in a bit!
Copy and paste the Zapier-generated webhook URL onto a new Onfleet webhook
This will enable Onfleet to send an event update of your choice over to Zapier as the trigger. By the time you reach this section, you're halfway there!
Simulating an Event Trigger
In order for the "Webhooks by Zapier" app to pull sample data, you will need to simulate a trigger of your interest after creating the webhook. The list of Onfleet webhooks are listed in the webhook documentation.
Assuming you want your trigger to be "Task started", simply create a task and start a task after creating the webhook. Same goes if you want your trigger to be "Task deleted", you should simulate deleting a task once the webhook is created.
Once you've simulated an event, go back to your Zap and click on "OK, I did this". The webhook will then pull the simulated event into a list of hooks for you as shown:
Here you will see the details of the simulated event with a trigger name of taskCreated, this "Payload" is what you can work off of, setting up filters and conditions before performing follow up actions.
Setting up Actions
As an example, I'm going to setup an automated email when my event is triggered. Once the webhook sample is selected, the webhook actions can now pull in all the information from the payload.
By clicking on the + button next to each field, you can search through the payload to find the data that you want to utilize in your automation. For example, I've parsed out the destination address and the taskID into the body of the email.
The last step would be testing out the event actions, follow the steps accordingly to send a test email to your recipient of interest.
Additional Action Steps (Optional)
For business purposes, one may opt in to add additional steps to the webhook. To do so, simply go to your Zapier dashboard and select your zap. On the left panel, you can add a step in between the trigger and the action or even after the 1st action.
Sample additional action steps include: filters, delays, data formatter, or even another application zap. Click on the + sign to learn more about what Zapier offers.
Note: Remember to trigger a sample event when you update your integration, this ensures that you are pulling in the desired and up-to-date payload.