Forward webhooks to your customers for booking status updates

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.

  1. Create a free account on Integromat/ Make or log in.
  2. 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

  1. Click on + Create a new scenario.
     
    Bildschirmfoto_2021-11-11_um_16.18.49__1_.png
     
  2. Search and select Webhooks > choose Custom Webhook.
     
    Bildschirmfoto_2021-12-16_um_15.55.55.png
     
  3. Click on Add and name the custom webhook.
  4. Click on Copy address to clipboard to copy the URL of the webhook.
     
    Bildschirmfoto_2021-12-16_um_15.57.05.png

 

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

  1. Add another module by clicking on the + at the right side of the webhooks trigger.
     
    Bildschirmfoto_2021-12-16_um_16.28.12.png
     
  2. Select Flow Control > Router. The Router provides the option to create multiple paths, send out bookings status to multiple customers in the same scenario.
     
    Bildschirmfoto_2022-04-06_um_16.20.22.png

 

Add a HTTP module to send out data to the customer

  1. Search and select HTTP and choose Make a request.
     
    Bildschirmfoto_2021-11-30_um_15.25.31.png
     
  2. 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
  3. Choose Method: POST
  4. Choose Body type: Raw
  5. 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]}}"
      ]
      }
      }
      ]
  6. Hit OK.
     
    Bildschirmfoto_2022-04-06_um_16.16.17.png

 

Create a filter to catch booking events of the desired customer only

  1. 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.
  2. 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.
     
    Bildschirmfoto_2022-04-06_um_15.23.31.png

 

Setup the filter in Integromat/ Make

  1. Click on the connection between Router and the HTTP module.
     
    Bildschirmfoto_2022-04-06_um_16.27.05.png
     
  2. A label can be given that explains what the filter is doing e.g. “If Customer A”.
  3. Set condition:
    • {{1.data.affected_user_ids}}
    • Select Contains.
    • Paste the customer_id in the field below “Contains”.
    • Hit OK.
  4. Don't forget to hit Save and turn on scenario when you're finished!

 

Test the scenario

  1. 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.
  2. Create a booking on MotionTools for your customer and start the booking as a driver.
  3. 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.
     
    Bildschirmfoto_2022-04-06_um_16.43.09.png
     
  4. Expand the “Data" to check the results of your request.
  5. Status code of the should be 200 indicating your call was successful. Read API docs for more.
  6. 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.
Was this article helpful?
0 out of 0 found this helpful

Articles in this section