Webhooks are used to integrate external applications with TrendMiner to initiate actions not normally conducted within TrendMiner. This feature is an option that can be found under Monitor configuration when setting up a monitor.
Webhook monitoring uses trigger-based URLs (webhooks) taken from third party applications such as built.io and webmethods. By providing a webhook, TrendMiner can perform HTTP calls to your specific URL whenever a monitor triggers. These calls can, for example, be used in the automated workflows that run in your selected third party applications. For each monitor result, TrendMiner will send out two calls to the webhook: one when the search criteria are met and one when the search result ends.
Why use webhook monitoring?
Increased automation of workflows
Under normal circumstances your data historians communicate with TrendMiner, but TrendMiner does not communicate back. Webhook monitoring enables TrendMiner to speak back enabling the integration of TrendMiner with any third party applications you use in your day-to-day business.
For example, if TrendMiner detects that storage levels are low in a monitored tank, TrendMiner's monitoring facility when equipped with a webhook could communicate this to another application which automatically generates a product order document which is sent directly to procurement.
Without a webhook, setting up this process would include a lot more manual steps.
How to use webhooks
- Ensure you have a third party tool which can provide a webhook.
- Set up a search or fingerprint monitor, goto Setting up a monitor article.
- On the monitor configuration, select Call webhook and enter your webhook URL. You can test it by clicking on the button “Test URL”. This will send a default, example response to the provided URL.
- Enable the monitor.
The response of the webhook will be a JSON object which looks as follows:
"searchDescription":"Description of my value based search" ,
"searchName": "My value based search",
The resultScore key will only be present for similarity search-based monitors. For each monitor, two webhook calls will be performed, one for the initial trigger of the monitor and one for the end of the search result. The webhookCallEvent key will be equal to start or end, respectively.
The resultStart and resultEnd keys indicate the start and end times of the detected monitor result, while the webhookCallTime indicates the time the webhook call was sent. All timestamps are formatted as UTC time.