You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-central/core/howto-control-devices-with-rest-api.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ In IoT Central, a module refers to an IoT Edge module running on a connected IoT
52
52
Use the following request to retrieve the components from a device called `temperature-controller-01`:
53
53
54
54
```http
55
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/temperature-controller-01/components?api-version=2022-05-31
55
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/temperature-controller-01/components?api-version=2022-07-31
56
56
```
57
57
58
58
The response to this request looks like the following example. The `value` array contains details of each device component:
@@ -87,7 +87,7 @@ The response to this request looks like the following example. The `value` array
87
87
Use the following request to retrieve a list of modules running on a connected IoT Edge device called `environmental-sensor-01`:
88
88
89
89
```http
90
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/environmental-sensor-01/modules?api-version=2022-05-31
90
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/environmental-sensor-01/modules?api-version=2022-07-31
91
91
```
92
92
93
93
The response to this request looks like the following example. The array of modules only includes custom modules running on the IoT Edge device, not the built-in `$edgeAgent` and `$edgeHub` modules:
@@ -110,15 +110,15 @@ The response to this request looks like the following example. The array of modu
110
110
Use the following request to retrieve a list of the components in a module called `SimulatedTemperatureSensor`:
111
111
112
112
```http
113
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/environmental-sensor-01/modules?api-version=2022-05-31
113
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/environmental-sensor-01/modules?api-version=2022-07-31
114
114
```
115
115
116
116
## Read telemetry
117
117
118
118
Use the following request to retrieve the last known telemetry value from a device that doesn't use components. In this example, the device is called `thermostat-01` and the telemetry is called `temperature`:
119
119
120
120
```http
121
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/thermostat-01/telemetry/temperature?api-version=2022-05-31
121
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/thermostat-01/telemetry/temperature?api-version=2022-07-31
122
122
```
123
123
124
124
The response to this request looks like the following example:
@@ -133,7 +133,7 @@ The response to this request looks like the following example:
133
133
Use the following request to retrieve the last known telemetry value from a device that does use components. In this example, the device is called `temperature-controller-01`, the component is called `thermostat2`, and the telemetry is called `temperature`:
134
134
135
135
```http
136
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/temperature-controller-01/components/thermostat2/telemetry/temperature?api-version=2022-05-31
136
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/temperature-controller-01/components/thermostat2/telemetry/temperature?api-version=2022-07-31
137
137
```
138
138
139
139
The response to this request looks like the following example:
@@ -148,7 +148,7 @@ The response to this request looks like the following example:
148
148
If the device is an IoT Edge device, use the following request to retrieve the last known telemetry value from a module. This example uses a device called `environmental-sensor-01` with a module called `SimulatedTemperatureSensor` and telemetry called `ambient`. The `ambient` telemetry type has temperature and humidity values:
149
149
150
150
```http
151
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/environmental-sensor-01/modules/SimulatedTemperatureSensor/telemetry/ambient?api-version=2022-05-31
151
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/environmental-sensor-01/modules/SimulatedTemperatureSensor/telemetry/ambient?api-version=2022-07-31
152
152
```
153
153
154
154
The response to this request looks like the following example:
@@ -171,7 +171,7 @@ The response to this request looks like the following example:
171
171
Use the following request to retrieve the property values from a device that doesn't use components. In this example, the device is called `thermostat-01`:
172
172
173
173
```http
174
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/thermostat-01/properties?api-version=2022-05-31
174
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/thermostat-01/properties?api-version=2022-07-31
175
175
```
176
176
177
177
The response to this request looks like the following example. It shows the device is reporting a single property value:
@@ -190,7 +190,7 @@ The response to this request looks like the following example. It shows the devi
190
190
Use the following request to retrieve property values from all components. In this example, the device is called `temperature-controller-01`:
191
191
192
192
```http
193
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/temperature-controller-01/properties?api-version=2022-05-31
193
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/temperature-controller-01/properties?api-version=2022-07-31
194
194
```
195
195
196
196
The response to this request looks like the following example:
@@ -261,7 +261,7 @@ The response to this request looks like the following example:
261
261
Use the following request to retrieve a property value from an individual component. In this example, the device is called `temperature-controller-01` and the component is called `thermostat2`:
262
262
263
263
```http
264
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/temperature-controller-01/components/thermostat2/properties?api-version=2022-05-31
264
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/temperature-controller-01/components/thermostat2/properties?api-version=2022-07-31
265
265
```
266
266
267
267
The response to this request looks like the following example:
@@ -277,10 +277,10 @@ The response to this request looks like the following example:
277
277
}
278
278
```
279
279
280
-
If the device is an IoT Edge device, use the following request to retrieve property values from a from a module. This example uses a device called `environmental-sensor-01` with a module called `SimulatedTemperatureSensor`:
280
+
If the device is an IoT Edge device, use the following request to retrieve property values from a module. This example uses a device called `environmental-sensor-01` with a module called `SimulatedTemperatureSensor`:
281
281
282
282
```http
283
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/environmental-sensor-01/modules/SimulatedTemperatureSensor/properties?api-version=2022-05-31
283
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/environmental-sensor-01/modules/SimulatedTemperatureSensor/properties?api-version=2022-07-31
284
284
```
285
285
286
286
The response to this request looks like the following example:
@@ -310,7 +310,7 @@ Some properties are writable. For example, in the thermostat model the `targetTe
310
310
Use the following request to write an individual property value to a device that doesn't use components. In this example, the device is called `thermostat-01`:
The request body looks like the following example:
@@ -339,7 +339,7 @@ The response to this request looks like the following example:
339
339
Use the following request to write an individual property value to a device that does use components. In this example, the device is called `temperature-controller-01` and the component is called `thermostat2`:
The request body looks like the following example:
@@ -368,7 +368,7 @@ The response to this request looks like the following example:
368
368
If the device is an IoT Edge device, use the following request to write an individual property value to a module. This example uses a device called `environmental-sensor-01`, a module called `SimulatedTemperatureSensor`, and a property called `SendInterval`:
369
369
370
370
```http
371
-
PUT https://{your app subdomain}.azureiotcentral.com/api/devices/environmental-sensor-01/modules/SimulatedTemperatureSensor/properties?api-version=2022-05-31
371
+
PUT https://{your app subdomain}.azureiotcentral.com/api/devices/environmental-sensor-01/modules/SimulatedTemperatureSensor/properties?api-version=2022-07-31
372
372
```
373
373
374
374
The request body looks like the following example:
@@ -399,13 +399,13 @@ The response to this request looks like the following example:
399
399
If you're using an IoT Edge device, use the following request to retrieve property values from a module:
400
400
401
401
```http
402
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/{deviceId}/modules/{moduleName}/properties?api-version=2022-05-31
402
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/{deviceId}/modules/{moduleName}/properties?api-version=2022-07-31
403
403
```
404
404
405
405
If you're using an IoT Edge device, use the following request to retrieve property values from a component in a module:
406
406
407
407
```http
408
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/{deviceId}/modules/{moduleName}/components/{componentName}/properties?api-version=2022-05-31
408
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/{deviceId}/modules/{moduleName}/components/{componentName}/properties?api-version=2022-07-31
409
409
```
410
410
411
411
## Call commands
@@ -415,7 +415,7 @@ You can use the REST API to call device commands and retrieve the device history
415
415
Use the following request to call a command on device that doesn't use components. In this example, the device is called `thermostat-01` and the command is called `getMaxMinReport`:
416
416
417
417
```http
418
-
POST https://{your app subdomain}.azureiotcentral.com/api/devices/thermostat-01/commands/getMaxMinReport?api-version=2022-05-31
418
+
POST https://{your app subdomain}.azureiotcentral.com/api/devices/thermostat-01/commands/getMaxMinReport?api-version=2022-07-31
419
419
```
420
420
421
421
The request body looks like the following example:
@@ -444,7 +444,7 @@ The response to this request looks like the following example:
444
444
To view the history for this command, use the following request:
445
445
446
446
```http
447
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/thermostat-01/commands/getMaxMinReport?api-version=2022-05-31
447
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/thermostat-01/commands/getMaxMinReport?api-version=2022-07-31
448
448
```
449
449
450
450
The response to this request looks like the following example:
@@ -469,15 +469,15 @@ The response to this request looks like the following example:
469
469
Use the following request to call a command on device that does use components. In this example, the device is called `temperature-controller-01`, the component is called `thermostat2`, and the command is called `getMaxMinReport`:
470
470
471
471
```http
472
-
POST https://{your app subdomain}.azureiotcentral.com/api/devices/temperature-controller-01/components/thermostat2/commands/getMaxMinReport?api-version=2022-05-31
472
+
POST https://{your app subdomain}.azureiotcentral.com/api/devices/temperature-controller-01/components/thermostat2/commands/getMaxMinReport?api-version=2022-07-31
473
473
```
474
474
475
475
The formats of the request payload and response are the same as for a device that doesn't use components.
476
476
477
477
To view the history for this command, use the following request:
478
478
479
479
```http
480
-
GET https://{your app subdomain}.azureiotcentral.com/api/devices/temperature-controller-01/components/thermostat2/commands/getMaxMinReport?api-version=2022-05-31
480
+
GET https://{your app subdomain}.azureiotcentral.com/api/devices/temperature-controller-01/components/thermostat2/commands/getMaxMinReport?api-version=2022-07-31
You can use this to perform an incremental update to an export. The sample request body looks like the following example which updates the `displayName` to a destination:
137
+
You can use this to perform an incremental update to an export. The sample request body looks like the following example that updates the `displayName` to a destination:
138
138
139
139
```json
140
140
{
@@ -306,7 +306,7 @@ The response to this request looks like the following example:
You can use this to perform an incremental update to an export. The sample request body looks like the following example which updates the `enrichments` to an export:
309
+
You can use this to perform an incremental update to an export. The sample request body looks like the following example that updates the `enrichments` to an export:
Copy file name to clipboardExpand all lines: articles/iot-central/core/howto-manage-device-templates-with-rest-api.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ The IoT Central REST API lets you:
43
43
Use the following request to create and publish a new device template. Default views are automatically generated for device templates created this way.
44
44
45
45
```http
46
-
PUT https://{subdomain}.{baseDomain}/api/deviceTemplates/{deviceTemplateId}?api-version=2022-05-31
46
+
PUT https://{subdomain}.{baseDomain}/api/deviceTemplates/{deviceTemplateId}?api-version=2022-07-31
47
47
```
48
48
49
49
>[!NOTE]
@@ -318,7 +318,7 @@ The response to this request looks like the following example:
318
318
Use the following request to retrieve details of a device template from your application:
319
319
320
320
```http
321
-
GET https://{subdomain}.{baseDomain}/api/deviceTemplates/{deviceTemplateId}?api-version=2022-05-31
321
+
GET https://{subdomain}.{baseDomain}/api/deviceTemplates/{deviceTemplateId}?api-version=2022-07-31
322
322
```
323
323
324
324
>[!NOTE]
@@ -450,13 +450,13 @@ The response to this request looks like the following example:
0 commit comments