TH NextGen - Webhooks

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

  1. Ensure you have a third party tool which can provide a webhook.
  2. Set up a search or fingerprint monitor, goto Setting up a monitor article.
  3. 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.
  4. Enable the monitor.

screenshot9.png

Technical information

The response of the webhook will be a JSON object which looks as follows:

{

"monitorId":1,

"resultEnd":"2019-02-02T02:02:02.000Z",

"resultId":2,

"resultScore":100,

"resultStart":"2019-01-01T01:01:01.000Z",

"resultUrl":"http://10.230.254.120/#/chart/monitoring/match/2",

"searchCreator":"UserX",

"searchDescription":"Description of my value based search" ,

"searchId":3,

"searchName": "My value based search",

"searchType":"valuebased"

,"webhookCallEvent":"start"

,"webhookCallTime":"2019-07-05T14:32:51.382Z"

}

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.

Enjoying TrendMiner? Share your experience to help the community and receive $25.
Rate TrendMiner