Query Desired Properties

Last Updated on : 2023-11-23 06:18:40download

Based on the device ID, query the list of desired properties of the specified device.

API address

GET: /v2.0/cloud/thing/{device_id}/shadow/properties/desired

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueThe device ID.
codesStringqueryfalseThe list of property codes, separated with commas (,).

Return parameter

Parameter nameTypeDescription
resultObjectThe returned result.

Description of result

Parameter nameTypeDescription
propertiesListThe list of desired properties.

Description of properties

Parameter nameTypeDescription
dpIdIntegerThe ID of the specified property.
codeStringThe code of the specified property.
valueObjectThe value of the specified property.
expire_timeLongThe expiration time.
statusIntegerIndicates whether the specified property is pushed to the device status. Valid values:
  • 0: no
  • 1: yes
timeLongThe timestamp when the property was configured.

Request example

GET: /v2.0/cloud/thing/372817193*****/shadow/properties/desired

Return example

{
    "result": {
        "properties": [
            {
                "code": "switch_led",
                "dpId": 20,
                "expire_time": 1678427008528,
                "time": 1669797124390,
                "value": false,
                "status": 1
            }
        ]
    },
    "t": 1675393820827,
    "success": true
}

Error code

For more information, see error code.

Limits on API Request Frequency

For more information, see Limits on API Request Frequency.