Examples: Rule Triggered Webhook Messages

Examples: Rule Triggered Webhook Messages

October 9, 2020
TeamViewer IoT Documentation

A Webhook can be thrown when a Rule was triggered. Webhooks are sent via HTTP POST message to a specified url. The message contains JSON documents.

The examples below show Webhook message examples for your reference.

Webhook Endpoint Confirmation

{ "Type": "ChannelConfirmation", 
  "Message": "You have received this request because your webhook URL has been added to the TeamViewer IoT notification channel list. To confirm this channel visit the ConfirmationURL included in this message" , 
  "ConfirmationURL": "https://mywebhook.com/confirmation/eyJ0aW1lU3RhbXAiOjE1Mjk0NzU1OTQwNzYsImNoYW5uZWxOYW1lIjoidGVzdCIsImNoYW5uZWxUeXBlIjoxLCJ1c2VySWQiOiI1YjI3YjI5ZGY2N2VjM2Y1MTAxMDUxNjkiLCJjaGFubmVsSWQiOiI1YjI5ZjIwYTMzNmJjNzUzZjA5M2Q1YWMiLCJ0YXJnZXQiOiJodHRwczovL3dlYmhvb2suc2l0ZS8zMjBmZTQ1Mi1kNzZmLTQ0YTUtYWFiZC04MDAzYTIyZTRlZWEifQ=="
}
{
    "Type": "ChannelConfirmationResponse",
    "Message": "Webhook channel has been successfully confirmed",
    "Timestamp": 1529475719718
}
{
    "Type": "ChannelConfirmationResponse",
    "Message": "Webhook channel  has already been confimred.",
    "Timestamp": 1529475731790
}

Rule Met

<pre class="wp-block-syntaxhighlighter-code">{
  "StartTime": 1501068864000,
  "ruleName": "Default alarm policy",
  "condition": "raspberrypi.dht22.temperature < 3",
  "consecutiveChecks": 4,
  "values": {
    "raspberrypi.dht22.temperature": 2
  }
}</pre>

Rule Recovered

<pre class="wp-block-syntaxhighlighter-code">{
  "endTime": 1501068864000,
  "duration": "2 hour(s) 45 minute(s)",
  "ruleName": "Default alarm policy",
  "condition": "raspberrypi.dht22.temperature < 2",
  "consecutiveChecks": 4,
  "values": {
    "raspberrypi.dht22.temperature": 5
  }
}</pre>

Related posts

Want more? Exclusive deals, the latest news: Our Newsletter!