Skip to content

Commit 23e0928

Browse files
authored
Merge pull request #110248 from viv-liu/viviali-webhooks-change
Webhook payload update
2 parents 596710f + cf9e6a4 commit 23e0928

File tree

1 file changed

+73
-1
lines changed

1 file changed

+73
-1
lines changed

articles/iot-central/core/howto-create-webhooks.md

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Create webhooks on rules in Azure IoT Central | Microsoft Docs
33
description: Create webhooks in Azure IoT Central to automatically notify other applications when rules fire.
44
author: viv-liu
55
ms.author: viviali
6-
ms.date: 12/02/2019
6+
ms.date: 04/03/2020
77
ms.topic: how-to
88
ms.service: iot-central
99
services: iot-central
@@ -38,6 +38,78 @@ Now when the rule is triggered, you see a new request appear in RequestBin.
3838

3939
When a rule is triggered, an HTTP POST request is made to the callback URL containing a json payload with the telemetry, device, rule, and application details. The payload could look like the following:
4040

41+
```json
42+
{
43+
"timestamp": "2020-04-06T00:20:15.06Z",
44+
"action": {
45+
"id": "<id>",
46+
"type": "WebhookAction",
47+
"rules": [
48+
"<rule_id>"
49+
],
50+
"displayName": "Webhook 1",
51+
"url": "<callback_url>"
52+
},
53+
"application": {
54+
"id": "<application_id>",
55+
"displayName": "Contoso",
56+
"subdomain": "contoso",
57+
"host": "contoso.azureiotcentral.com"
58+
},
59+
"device": {
60+
"id": "<device_id>",
61+
"etag": "<etag>",
62+
"displayName": "MXChip IoT DevKit - 1yl6vvhax6c",
63+
"instanceOf": "<device_template_id>",
64+
"simulated": true,
65+
"provisioned": true,
66+
"approved": true,
67+
"cloudProperties": {
68+
"City": {
69+
"value": "Seattle"
70+
}
71+
},
72+
"properties": {
73+
"deviceinfo": {
74+
"firmwareVersion": {
75+
"value": "1.0.0"
76+
}
77+
}
78+
},
79+
"telemetry": {
80+
"<interface_instance_name>": {
81+
"humidity": {
82+
"value": 47.33228889360127
83+
}
84+
}
85+
}
86+
},
87+
"rule": {
88+
"id": "<rule_id>",
89+
"displayName": "Humidity monitor"
90+
}
91+
}
92+
```
93+
If the rule monitors aggregated telemetry over a period of time, the payload will contain a different telemetry section.
94+
95+
```json
96+
{
97+
"telemetry": {
98+
"<interface_instance_name>": {
99+
"Humidity": {
100+
"avg": 39.5
101+
}
102+
}
103+
}
104+
}
105+
```
106+
107+
## Data format change notice
108+
109+
If you have one or more webhooks created and saved before **3 April 2020**, you will need to delete the webhook and create a new webhook. This is because older webhooks use an older payload format that will be deprecated in the future.
110+
111+
### Webhook payload (format deprecated as of 3 April 2020)
112+
41113
```json
42114
{
43115
"id": "<id>",

0 commit comments

Comments
 (0)