Queries all the property snapshots of a device or digital twin node.

Usage notes

To query the property data of a digital twin node, you must set the IotId parameter to the ID of the digital twin node.

QPS limits

Each Alibaba Cloud account can run up to 200 queries per second (QPS).

Note The RAM users of an Alibaba Cloud account share the quota of the Alibaba Cloud account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesQueryDevicePropertyStatus

The operation that you want to perform. Set the value to QueryDevicePropertyStatus.

IotInstanceIdStringNoiot_instc_pu****_c*-v64********

The ID of the instance. You can view the ID of the instance on the Overview page in the IoT Platform console.

Important
  • If your instance has an ID, you must specify the ID for this parameter. Otherwise, the call fails.
  • If no Overview page or instance ID appears in the console, you do not need to configure this parameter.

For more information, see Overview.

ProductKeyStringNoa1BwAGV****

The ProductKey of the product to which the device belongs.

Important

If you specify this parameter, you must also specify the DeviceName parameter.

DeviceNameStringNolight

The DeviceName of the device.

Important

If you specify this parameter, you must also specify the ProductKey parameter.

IotIdStringNoQ7uOhVRdZRRlDnTLv****00100

The ID of the device or digital twin node whose property data you want to query.

  • You can call the QueryDeviceInfo operation to query the ID of the device.
  • Log on to the IoT Platform console. On the Twin Details page, click the digital twin node to view its ID.
Important

If you specify this parameter, you do not need to specify the ProductKey and DeviceName parameters. The IotId parameter specifies a globally unique identifier (GUID) for the device. The value of the IotId parameter corresponds to a combination of the values of the ProductKey and DeviceName parameters. If you specify the IotId, ProductKey, and DeviceName parameters, the value of the IotId parameter takes precedence.

FunctionBlockIdStringNoBatteryModule

The identifier of the custom TSL module. Each identifier is unique in a product.

If you do not specify this parameter, the system queries the data of the default module.

In addition to the preceding operation-specific request parameters, you must configure common request parameters when you call this operation. For more information, see Common parameters.

Response parameters

ParameterTypeExampleDescription
CodeStringiot.system.SystemException

The error code returned if the call fails. For more information, see Error codes.

DataStruct

The data returned if the call succeeds. For more information, see List.

ListArray of PropertyStatusInfo

The array of property information. The information about each property is indicated by the PropertyStatusInfo parameter.

PropertyStatusInfo
DataTypeStringint

The data type of the property. Valid values:

  • int: integer
  • float: single-precision floating-point number
  • double: double-precision floating-point number
  • enum: enumeration
  • bool: Boolean
  • text: character
  • date: time (string-type UTC timestamp in milliseconds)
  • array: array
  • struct: structure
IdentifierStringTemperature

The identifier of the property.

NameStringtemperature

The name of the property.

TimeString1517553572362

The time when the property was modified, in milliseconds.

UnitString°C

The unit of the property value.

ValueString25

The value of the property.

ErrorMessageStringA system exception occurred.

The error message returned if the request fails.

RequestIdStringE55E50B7-40EE-4B6B-8BBE-D3ED55CCF565

The ID of the request.

SuccessBooleantrue

Indicates whether the call was successful.

  • true: The call was successful.
  • false: The call failed.

Examples

Sample requests

https://iot.cn-shanghai.aliyuncs.com/?Action=QueryDevicePropertyStatus
&ProductKey=a1rYuVF****
&DeviceName=device1
&<Common request parameters>

Sample success responses

XML format

<QueryDevicePropertyStatusResponse>
  <Data>
        <List>
              <PropertyStatusInfo>
                    <Name>Humidity</Name>
                    <Value>48</Value>
                    <Time>1579249151178</Time>
                    <DataType>int</DataType>
                    <Identifier>Humidity</Identifier>
                    <Unit>%</Unit>
              </PropertyStatusInfo>
              <PropertyStatusInfo>
                    <Name> Temperature</Name>
                    <Value>32.46</Value>
                    <Time>1579249151178</Time>
                    <DataType>float</DataType>
                    <Identifier>Temperature</Identifier>
                    <Unit>°C</Unit>
              </PropertyStatusInfo>
        </List>
  </Data>
  <RequestId>84BAD25B-9879-4BA1-9213-F576C6558D77</RequestId>
  <Success>true</Success>
</QueryDevicePropertyStatusResponse>

JSON format

{
    "Data": {
        "List": {
            "PropertyStatusInfo": [
                {
                    "Name": "Humidity",
                    "Value": "48",
                    "Time": "1579249151178",
                    "DataType": "int",
                    "Identifier": "Humidity",
                    "Unit": "%"
                },
                {
                    "Name": "Temperature",
                    "Value": "32.46",
                    "Time": "1579249151178",
                    "DataType": "float",
                    "Identifier": "Temperature",
                    "Unit": "°C"
                }
            ]
        }
    },
    "RequestId": "84BAD25B-9879-4BA1-9213-F576C6558D77",
    "Success": true
}

Error codes

For a list of error codes, visit the API Error Center.