This article explains what a webhook is and how to connect one.
A webhook is a mechanism for notifying a system about events.
Suppose there is a service that must report events the moment they happen. One option is to keep polling the server for new data, but the downside is speed: the server may, for example, impose a delay on fetching new notifications. A webhook fixes this: when an event happens, it calls a site address with parameters, for example "example.com/webhook/notification", and passes JSON (usually) with fresh data in the body of a POST request.
How to connect a webhook to your bot
First, sign up for Integromat.
In the left menu, go to "Scenarios".
Create a new scenario with the "Create a new scenario" button in the upper right corner.
The system shows all modules. Type "Webhook" in the search, select it and click "Continue" (upper right corner).
Now apply the webhook function to the module: click the question mark — "Webhooks" — "Add" — enter a name — "Save".
Important! Copy the link the module generated — this is your webhook. Don't forget to save everything with the "OK" button.
6. Now open your puzzlebot account, go to your bot's Settings tab and open the Event subscriptions section.
7. Click the blue "Add" button.
8. In the Address field, paste your webhook (the one you copied). To edit it later, use the "Edit" button.
9. In the Event type field, select the event (message) the bot will send to the Integromat server for further processing. Learn more about event types in the article: Event subscriptions.
Test run
Before you run any scenario, you must first receive some data (some content) so that you can work with it, for example send it to other services. This is a mandatory condition that must be met right after connecting the webhook.
Connect the webhook.
In Integromat, start the scenario (either once with the "Run Once" button, or continuously with the "On/Off" switch at the bottom).
Go to the bot and complete the input form.
As soon as Integromat receives the content sent to it (from the required form, or a specific command; learn more in the article: Event subscriptions), an indicator with the number 1 appears above the Webhook module, along with other related indicators.
That's it, Integromat has received the data it needs. Now you can get to work.