Query Properties

Last Updated on : 2024-06-29 01:25:18download

Based on the device ID, query the property status reported by the device to the cloud.

API address

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

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 properties.

Description of properties

Parameter nameTypeDescription
codeStringThe code of the specified property.
timeLongThe timestamp when the property value was updated.
valueObjectThe value of the specified property.
custom_nameStringThe custom name.
dp_idIntegerThe ID of the specified property.

Request example

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

Return example

{
    "result": {
        "properties": [
            {
                "code": "switch_led",
                "custom_name": "cole_red",
                "dp_id": 20,
                "time": 1669797124390,
                "value": true
            }
        ]
    },
    "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.