Overview
This page explains how to create a Webhook and use Integromat/ Make to forward status updates of bookings to one of your customers. Different tools can be used as well, please read our API Docs for more information.
Get access to Integromat/ Make
Integromat/ Make is a powerful tool to integrate platforms together, run complex scripts or automate recurring tasks using API Calls.
Create a free account on Integromat/ Make or log in.
You have 1000 free monthly tasks before the need to upgrade to a paid plan.
Create a new scenario with a custom webhook in Integromat/ Make
Click on + Create a new scenario.
Search and select Webhooks > choose Custom Webhook.
Click on Add and name the custom webhook.
Click on Copy address to clipboard to copy the URL of the webhook.
Create a webhook in MotionTools
Read the tutorial on how to Create a webhook in MotionTools. If the customer uses bookings, use the “hailing_booking_stop.transition
” webhook.
Add a router
Add another module by clicking on the + at the right side of the webhooks trigger.
Select Flow Control > Router. The Router provides the option to create multiple paths, send out bookings status to multiple customers in the same scenario.
Add a HTTP module to send out data to the customer
Search and select HTTP and choose Make a request.
Please find out from your customer for a specific webhook URL they want to receive the status events from. Enter their URL in the URL field of the HTTP module. Example URL:
https://hook.eu1.make.com/testexamplea9sjs7ostoertwdfsdfhjwlrkgjklfgsldk
Choose Method:
POST
Choose Body type:
Raw
Choose Content-type:
JSON (application/json)
Request-content
[
{
"id": "##{{1.id}}",
"timestamp": "##{{1.timestamp}}",
"resource_type": "##{{1.resource_type}}",
"event": "##{{1.event}}",
"data": { "booking_id": "##{{1.data.booking_id}}",
"stop_id": "##{{1.data.stop_id}}",
"from": "##{{1.data.from}}",
"to": "##{{1.data.to}}",
"event": "##{{1.data.event}}",
"affected_user_ids": [
"##{{1.data.affected_user_ids[1]}}",
"##{{1.data.affected_user_ids[2]}}"
]
}
}
]
Hit OK.
Create a filter to catch booking events of the desired customer only
As the webhook
hailing_booking.stop.transition
gives all kinds of transitions for each customer on the platform, you can use the filter to only continue if the customer id matches the desired customer.For this, the unique customer_id those booking are created for is needed. You can find the customer id on the Dashboard > Customers > click on specific customer > locate customer id in the URL.
Setup the filter in Integromat/ Make
Click on the connection between Router and the HTTP module.
A label can be given that explains what the filter is doing e.g. “If Customer A”.
Set condition:
##{{1.data.affected_user_ids}}
Select Contains.
Paste the
customer_id
in the field below “Contains”.Hit OK.
Don't forget to hit Save and turn on scenario when you're finished!
Test the scenario
Hit Run once to test all modules together, or right click on one module and select Run this module only to test just one module.
Create a booking on MotionTools for your customer and start the booking as a driver.
As you see there was an incoming webhook from MotionTools informing that an action happened on a booking. The filter indicates that the customer matches with the customer_id you placed here.
Expand the “Data" to check the results of your request.
Status code of the should be 200 indicating your call was successful. Read API docs for more.
Don't forget to Save and turn on scenario when you're finished!
Additional notes
Communicate with the customer to check if they received the status webhooks.
Make sure to use the filter right. Otherwise, all bookings’ status updates from different customers would be sent to this customer.
You can click on + and add different HTTP modules for different customers. Use the same filter as above and enter a different customer_id that matches with the webhook URL provided by the customer.
Finally, if something was changed in the module, make sure to hit Save.