Webhook - Integrate with external apps

What is Webhook?

Webhooks are user-defined HTTP callbacks. They are triggered by events and are useful for integrating third-party apps with Distill. You can use webhook action in Distill to send POST requests to a webhook URL.

How to use Webhook action in Distill?

You can set webhook action from the actions list. It is available to paid customers only.

Here are the steps to add the webhook action.

  1. Go to the “Options page” by clicking on the monitor’s context menu option from down caret icon as shown below.

context menu for options page

  1. From the actions list, select “Webhook call” and add Webhook URL in the placeholder.
  2. Click on “Options” under Webhook to configure the Webhook parameters that you need to send as a POST request.

option for webhook parameters 4. You can also configure header parameters by clicking on “Header” under Webhook. 5. Save once you are done with webhook configurations.

Webhook Parameters

The following values can be used in the webhook parameter’s field.

  1. {{sieve.id}} - Id of the monitor.
  2. {{sieve.name}} - Name of the monitor.
  3. {{sieve.tags}} - The label of the monitor. This only works in cloud.
  4. {{sieve.uri}} - URL of the monitor.
  5. {{sieve_data.text}} - Text value of the monitor.
  6. {{sieve_data.ts}} - Timestamp when change was detected.
  7. {{sieve_data.data}} - HTML data of the monitor.

You can also combine the values. For example, value in a field can be: {{sieve_data.name}} - {{sieve.uri}} - {{sieve_data.text}}

This is how the default webhook fields look like.

webhook-fields

Troubleshooting

  1. Make sure that the webhook URL is publicly accessible.
  2. Check if you are subscribed to a paid plan from https://app.distill.io/settings/billing.
  3. Check if you have not reached the monthly quota for webhook actions from https://app.distill.io/analytics/monthly.
  4. To test your Webhook URL, you can add a test monitor for https://www.timeanddate.com/ (select current time) in Distill’s browser extension, and manually run the monitor to check the POST data. You can also use services like POSTMAN to send GET and receive POST requests on your test URL.

How to test the Webhook?

  1. Add a test monitor for https://www.timeanddate.com/ in the browser extension.
  2. Set webhook action and add a webhook URL from a testing provider site like https://webhook.site/ and save.
  3. Manually check this monitor from the Watchlist by clicking on the run button.

manual-check-button 4. Open the webhook site to check the POST data. It starts with https://webhook.site/#!/ followed by the URL id. This is how it looks like for the above test URL.

webhook-post-data-format