Web hooks

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 the Monitor option Web_hook_1.png in the TrendHub menu.

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 2 calls to the webhook: one when the search criteria are met and one when the search result ends. 

Why use web hook 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 webhook monitoring this process would be a lot more manual.

How to use webhooks

As an administrator

  1. Goto TrendHub tool menu.
  2. Click on the settings icon (cog).
  3. Click on feature management.
  4. Click the toggle for "Monitoring webhook notification" so it highlights green.

As an end user

  1. Ensure you have a third party url to use as a webhook.
  2. Prepare a search or fingerprint for purposes of a monitor.
  3. Goto the TrendHub tool menu and click on the monitoring icon Web_hook_1.png.
  4. Identify your chosen monitor and click on the associated toggle so it highlights green.
  5. Scroll down the bottom of the Monitor & Alerts settings page
  6. Click the checkbox on, and enter your webhook url.
  7. Click on the save button.

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 key 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. 

Web_hook_2.png