Call this operation to query the desired property values of a specified device.

Limits

Up to 10 properties can be queried at a time.

Request parameters

Parameter Type Required Description
Action String  Yes The operation that you want to perform. Set the value as QueryDeviceDesiredProperty.
IotId  String  No

The unique identifier of the device whose desired property values you want to query.

Note If you use this parameter, ProductKey and DeviceName are not required. IotId is a globally unique identifier of a device, and corresponds to a combination of ProductKey and DeviceName. If you specify both IotId and the combination of ProductKey and DeviceName, the system follows IotId.
ProductKey  String  No

The ProductKey of the device whose desired property values you want to query.

Note If you specify this parameter, DeviceName is required.
DeviceName  String  No

The name of the device whose desired property values you want to query.

Note If you specify this parameter, you must also specify ProductKey.
Identifiers List No

The identifiers of the properties whose desired values you want to query.

In the IoT Platform console, you can see identifiers of properties on the Define Feature page of the product to which the device belongs.

Note
  • You can specify up to 10 property identifiers in a call.
  • You cannot enter duplicate property identifiers.
  • If you do not specify this parameter, values of all properties are returned.
Common request parameters - No 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 has 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.
Data Data The property data returned when the call is successful. See the following table.
Table 1. Data
Parameter Type Description
List List<DesiredPropertyInfo> The collection of property information. See the following DesiredPropertyInfo table.
Table 2. DesiredPropertyInfo
Parameter Type Description
Identifier String The identifier of the property.
Name String The name of the property.
DataType String The data type of the property.
Time String The time when the desired value was modified last time, in milliseconds.
Value String The current desired value of the property.
Unit  String The unit of the property value.
Version Long

The current version number of the desired property value.

Examples

Request example

https://iot.cn-shanghai.aliyuncs.com/?Action=QueryDeviceDesiredProperty
&IotId=SR8FiTu1R9tlUR2V1bmi0010*****
&Identifier. 1=Weight
&Identifier. 2=Circle
&Common request parameters

Response example

  • JSON format
    {
        "RequestId":"57b144cf-09fc-4916-a272-a62902d5b207",
        "Success": true,
        "Data":{
            "List":{
                "DesiredPropertyInfo":[
                    {
                        "Name": "WeightName",
                        "Value": "50.0",
                        "Time": "1517553572362",
                        "DataType": "double",
                        "Identifier": "Weight",
                        "Unit": "C",
                        "Version": 10
                    },
    		{
                        "Name": "CircleName",
                        "Value": "50.0",
                        "Time": "1517553572362",
                        "DataType": "double",
                        "Identifier": "Circle",
                        "Unit": "C",
                        "Version": 10
                    }
                ]
            }
        }
    }
  • XML format
    <? xml version='1.0' encoding='utf-8'? >
    <QueryDeviceDesiredPropertyResponse>
        <RequestId>57b144cf-09fc-4916-a272-a62902d5b207</RequestId>
        <Success>true</Success>
        <Data>
            <List>
                <DesiredPropertyInfo>
                    <Time>1517553572362</Time>
                    <Name>doublePropertyName</Name>
                    <DataType>double</DataType>
                    <Identifier>doubleProperty</Identifier>
                    <Value>50.0</Value>
                    <Unit>C</Unit>
                    <Version>10</Version>
                </DesiredPropertyInfo>
                <DesiredPropertyInfo>
                    <Time>1517553572362</Time>
                    <Name>CircleName</Name>
                    <DataType>double</DataType>
                    <Identifier>Circle</Identifier>
                    <Value>50.0</Value>
                    <Unit>C</Unit>
                    <Version>10</Version>
                </DesiredPropertyInfo>
            </List>
        </Data>
    </QueryDeviceDesiredPropertyResponse>