Execute Device Capabilities in Bulk

Last Updated on : 2022-11-11 03:43:46

Execute multiple capabilities of the specified device in bulk. For example, turn on a switch and set the switch countdown at the same time.

API address

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

Request parameter

Description of body

Parameter nameTypeINRequiredDescription
capabilitiesList falseThe list of commands to execute capabilities of the specified device.

Description of capabilities

Parameter nameTypeINRequiredDescription
codeString falseThe code of the specified capability.
valueObject trueThe value sent to the device.
channelsList falseThe list of capability channels to be controlled, applicable to multi-channel products, such as a power strip.

Return parameter

Parameter nameTypeDescription
resultExecCapabilitiesResThe returned result.

Description of result

Parameter nameTypeDescription
request_resultBooleanThe execution result. Valid values:
  • true: All the capabilities are executed successfully.
  • false: Failed to execute one capability or several capabilities.

Request example

POST: /v1.0/iot-03/devices/64***dz/capabilities
{
  "capabilities": [
    {
      "code": "switch",
      "channel": [
        "1"
      ],
      "value": false
    }
  ]
}

Return example

{
    "tid": "7456215360d211ed8b2566906d2287eb",
    "result": {
        "request_result": true
    },
    "t": 1668069252995,
    "success": true
}

Error code

For more information, see error code.