Queries the original property records that are submitted by a specified device. These records include the records of properties that passed and failed the verification of a specified Thing Specification Language (TSL) model.

Usage notes

You can query only the property records that are generated within the previous 30 days.

Note The data of a property is stored from the day when the data is generated.

QPS limits

You can call this API operation up to 50 times per second per account.

Note The RAM users of an Alibaba Cloud account share the quota of the 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 for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesQueryDeviceOriginalPropertyData

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

AscIntegerYes0

The order in which you want to sort the returned property records. Valid values:

  • 0: descending.
  • 1: ascending.
Note The start time must be earlier than the end time. The system sorts the returned records based on the specified order.
EndTimeLongYes1579249499000

The end of the time range to query. The value must be a 13-digit timestamp.

IdentifierStringYestemperature

The identifier of the property.

  • If weak verification is used, you can perform the following steps to view the Identifier of a device property: Log on to the IoT Platform console and go to the Define Feature tab of the Product Details page. You can also call the QueryThingModel operation and view the property identifier in the returned TSL data.
  • If no verification is used, the value must be the same as the custom identifier that is submitted by the device.
PageSizeIntegerYes10

The maximum number of records that can be returned for each property. Maximum value: 100.

The number of records that are returned for an arbitrary property cannot exceed the limit.

StartTimeLongYes1569249488000

The start of the time range to query. The value must be a 13-digit timestamp.

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 ID is generated for your instance, 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 a value for this parameter, you must configure the DeviceName parameter.
DeviceNameStringNolight

The DeviceName of the device.

Important If you specify a value for this parameter, you must configure the ProductKey parameter.
NextPageTokenStringNoBo***x44Qx

The token that is used to retrieve the next page of the query results. If the next page exists, this parameter is returned. In this case, you must add the value of the parameter to the next request.

IotIdStringNoQ7uOhVRdZRRlDnTLv****00100

The ID of the device. The ID is a unique identifier that is issued by IoT Platform to the device.

Important The IotId parameter specifies a unique ID for the device. The value of the IotId parameter is equivalent to a combination of the values of the ProductKey and DeviceName.N parameters. If you specify the IotId parameter, you do not need to configure the ProductKey or DeviceName.N parameter. If you specify values for the IotId, ProductKey, and DeviceName.N parameters, the value of the IotId parameter takes precedence.

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

Response parameters

ParameterTypeExampleDescription
CodeStringiot.device.InvalidIoTId

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

DataStruct

The property records returned if the call is successful.

ListArray of PropertyInfo

The properties. Each element indicates a property.

PropertyInfo
TimeString1516541885630

The time when the property was modified.

ValueString2

The value of the property.

NextValidBooleantrue

Indicates whether the next page exists.

  • true: The next page exists.
  • false: The next page does not exist.

If true is returned for the NextValid parameter, you can add the value of the NextPageToken parameter to the next request. This way, you can query the data that is not included in the current query.

nextPageTokenStringBo***x44Qx

The token that is used to retrieve the next page of the query results.

ErrorMessageStringA system exception occurred.

The error message returned if the call fails.

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

The ID of the request.

SuccessBooleantrue

Indicates whether the call was successful. Valid values:

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

Examples

Sample requests

http(s)://iot.cn-shanghai.aliyuncs.com/?Action=QueryDeviceOriginalPropertyData
&Asc=0
&EndTime=1579249499000
&Identifier=temperature
&PageSize=10
&StartTime=1569249488000
&IotId=Q7uOhVRdZRRlDnTLv****00100
&<Common request parameters>

Sample success responses

XML format

<QueryDeviceOriginalPropertyDataResponse>
  <Data>
        <NextValid>false</NextValid>
        <nextPageToken>Bo***x44Qx</nextPageToken>
        <List>
              <PropertyInfo>
                    <Value>32.46</Value>
                    <Time>1579249151178</Time>
              </PropertyInfo>
        </List>
  </Data>
  <RequestId>45391E10-446B-4986-863E-1BA8CC44748F</RequestId>
  <Success>true</Success>
</QueryDeviceOriginalPropertyDataResponse>

JSON format

{
  "Data": {
    "NextValid": false, 
    "nextPageToken": "Bo***x44Qx", 
    "List": {
      "PropertyInfo": [
        {
          "Value": "32.46", 
          "Time": 1579249151178
        }
      ]
    }
  }, 
  "RequestId": "45391E10-446B-4986-863E-1BA8CC44748F", 
  "Success": true
}

Error codes

For a list of error codes, see Service error codes.