Use webhooks & Integromat to build custom integrations

This page explains how to create a webhook on MotionTools and use the API and Integromat to build a custom integration. Different tools can be used as well, please read our API Docs for more information.

 

Overview

 

Get API Key

Skip this step if you already have an API key. Otherwise, please read Create an API key for more information.

 

Get access to Integromat

Create a free account on Integromat. You will have 1000 free monthly tasks before the need to upgrade to a paid plan.

💡  Integromat is a powerful tool to integrate platforms together, run complex scripts or automate recurring tasks using API Calls.

 

Create a new scenario with a custom webhook in Integromat

  • Click on + Create a new scenario.

Bildschirmfoto_2021-11-11_um_16.18.49__2_.png

  • Search and select Webhooks and choose Custom Webhook.

Bildschirmfoto_2021-12-16_um_15.55.55.png

  • Click on Add and name the custom webhook.
  • 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

Please see Create a webhook in MotionTools for more information.

 

Add and edit modules to make an API call

  • Add another module by clicking + on the right side of the webhooks trigger.

Bildschirmfoto_2021-12-16_um_16.28.12.png

  • Search and select HTTP and choose Make a request

Bildschirmfoto_2021-11-30_um_15.25.31.png

  • Set URL to https://production.backend.core.m-tools.cloud/api/hailing/{{1.data.booking_id}}.
  • Choose Method GET
  • Add Authorization and Content-Type headers:
    • Name: Content-Type Value: application/json
    • Name: Authorization Value: paste your API key here Refer to Get API Key.
  • Select parse response.

Bildschirmfoto_2021-12-16_um_16.36.20.png

❗ Important: The default per page limit of responses of a call is 25. The max limit is 1000. To change the limit e.g. to 100, do this easily by adding ?limit=100 behind the URL. To retrieve values of a page other than the first, just add ?page=2 behind the URL with the number of the page you want to retrieve. To learn more about these and other query parameters and filters, please look into our API Docs.

Create a filter to catch completed bookings only

As the webhook hailing_booking.transition gives all kinds of transitions of each booking, use the Integromat filter to only proceed if the event is paid.

  • Click on the connection between both modules.
  • Give this a label that explains what the filter is filtering for.
  • Set Condition
    • {{1.data:event}}
    • Select Equal to
    • paid

 

Test the module

  • Hit Run once to test all modules together or right click on one module and select Run this module only to test one module only.
  • Wait until the operation finishes, then hit the circle on the top right above the module to view the results of your call.

Bildschirmfoto_2021-11-30_um_15.45.25.png

  • To test this, create a booking on MotionTools and run through it as a driver and complete the booking.
  • The status code should be 200, indicating your call was successful. View our API Docs for more information.
  • Expand Data to check the results of your request.

Bildschirmfoto_2021-12-16_um_16.46.46.png

  • Make sure to hit Save and turn on scenario under Scheduling at the bottom left corner. 

 

Add further steps to integrate to other platforms

Use additional HTTP requests to add further steps with the data you received from MotionTools. You can also use variables of the previous tested modules to bring them into the next modules in line (highlighted in blue). For more information, see this list of additional tools in Integromat.

Bildschirmfoto_2021-12-16_um_16.59.00.png

Was this article helpful?
0 out of 0 found this helpful

Articles in this section