English
English
简体中文
Contact Us
Register
Log In
layoutIndex

Send commands

Last Updated on : 2022-07-22 08:31:25download

Send commands to a device.

API address

POST: /v1.0/iot-03/devices/{device_id}/commands

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueDevice ID

Description of body

Parameter nameTypeINRequiredDescription
commandsList trueThe command to control a device

Description of commands

Parameter nameTypeINRequiredDescription
codeString trueCommand code
valueObject trueCommand value

Return parameter

Parameter nameTypeDescription
resultBoolean

Request example

POST: /v1.0/iot-03/devices/xxxid/commands
{
  "commands": [
    {
      "code": "switch_led",
      "value": true
    }
  ]
}

Return example

{
    "result": true,
    "t": 1551851043862,
    "success": true
}

Error code

For more information, see error code.