Call this operation to query the tags of a device.
Request parameters
Parameter | Type | Required | Description |
---|---|---|---|
Action | String | Yes | The operation that you want to perform. Set the value to QueryDeviceProp. |
IotId | String | No | The globally unique ID issued by IoT Platform to the device.
Note If you specify this parameter,
ProductKey and
DeviceName are not required.
IotId is the globally unique identifier (GUID) of a device, and corresponds to the combination of
ProductKey and
DeviceName. If you specify both
IotId and the combination of
ProductKeyand
DeviceName, the system follows
IotId.
|
ProductKey | String | No | The ProductKey of the device whose tags you want to query.
Note If you specify this parameter,
DeviceName is required.
|
DeviceName | String | No | The name of the device whose tags you want to query.
Note If you use this parameter,
ProductKey is required.
|
Common request parameters | - | Yes | See Common parameters. |
Response parameters
Parameter | Type | Description |
---|---|---|
RequestId | String | The globally unique ID generated by Alibaba Cloud for the request. |
Success | Boolean | Indicates whether the call is successful. A value of true indicates that the call is successful. A value of false indicates that the call failed. |
ErrorMessage | String | The error message returned when the call fails. |
Code | String | The error code returned when the call fails. For more information about error codes, see Error codes. |
Props | String | The information of device tags returned when the call is successful. |
Examples
Request example
https://iot.cn-shanghai.aliyuncs.com/?Action=QueryDeviceProp
&ProductKey=al*********
&DeviceName=device1
&Common request parameters
Response example
- JSON format
{ "RequestId": "D8CEF5E7-1484-4164-A242-C06BA3A54E0F", "Props": "{\"coordinate\":\"104.07086:30.549169\"}", "Success": true }
- XML format
<?xml version="1.0" encoding="UTF-8" ?> <QueryDevicePropResponse> <RequestId>D8CEF5E7-1484-4164-A242-C06BA3A54E0F</RequestId> <Props> <coordinate>104.07086:30.549169</coordinate> </Props> <Success>true</Success> </QueryDevicePropResponse>