Set Desired Property

Last Updated on : 2024-11-14 09:56:00download

Store the command of sending device properties in the cloud. When the device is woken up or goes online, the command is sent from the cloud to the device. Currently, this feature is only available for some low-power devices.

API address

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

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringpathtrueThe device ID.

Description of body

Parameter nameTypeINRequiredDescription
propertiesStringbodytrueThe properties supported by the device and the property value set.
durationLongbodytrueThe validity period in seconds.
typeIntegerbodyfalseThe type of desired properties. If this parameter is not filled, the default mode is used. Valid values:
  • 0: Proactive mode. The device proactively calls the API to query the desired properties.
  • 1: Default mode. When the device goes online, the cloud pushes the set properties to the device.

Return parameter

Parameter nameTypeDescription
resultJSONThe list of returned data.
successBooleanIndicates whether the operation is successful. Valid values:
  • true: The operation succeeded.
  • false: The operation failed.
tLongThe timestamp.
tidStringThe link ID.

Request example

POST: /v2.0/cloud/thing/vdevo1638******/shadow/properties/desired
{
  "properties": "{\"switch_1\":true}",
  "duration": 1000
}

Return example

{
    "tid": "77a9807fb74411edb9d75a827c79edfd",
    "result": {
    },
    "t": 1677574021435,
    "success": true
}

Error code

For more information, see error code.

Limits on API Request Frequency

For more information, see Limits on API Request Frequency.