Report Device Response

Last Updated on : 2023-06-20 12:39:05

Based on the device ID, report the response of the specified device to a control command. If the device does not respond to the received control command, it is considered that the execution of the sent control command fails.

API address

POST: /v1.0/iot-03/3rdcloud/devices/{device_id}/action-resp/report

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueThe ID of the specified Tuya-enabled device.

Description of body

Parameter nameTypeINRequiredDescription
msg_idStringbodytrueThe request ID for sending an action command, with up to 32 characters in length. This ID is used to correlate requests and responses.
codeIntegerbodyfalseThe code of the specified response. Valid values:
  • 0: success.
  • Other values: failure.
dataObjectbodyfalseThe output parameter of device actions.

Description of data

Parameter nameTypeINRequiredDescription
action_codeStringbodyfalseThe action code as a functional identifier.
output_paramsObjectbodyfalseThe output parameter for action execution.

Return parameter

Parameter nameTypeDescription
resultBooleanThe response result.
codeStringThe response code. It is empty when the request succeeded.
msgStringThe message that is returned if the request fails. It is empty if the request is successful.
successBooleanIndicates whether the request is successful. Valid values:
  • true: success.
  • false: failure.
tLongThe 13-digit timestamp of a response.

Request example

POST: /v1.0/iot-03/3rdcloud/devices/6cf4171005d11e2ca7****/action-resp/report
{
  "msg_id": "ed23rty159292****",
  "code": 0,
  "data": {
    "action_code": "turn_direction",
    "output_params": {
      "turn_left": 80,
      "turn_right": 30
    }
  }
}

Return example

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

Error code

For more information, see error code.