Contact Us
Log In

Report Device Response

Last Updated on : 2022-05-23 01:43:13

A device responds to a control command. If the device does not respond to the 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 a Tuya device.

Description of body

Parameter nameTypeINRequiredDescription
msg_idStringbodytrueThe request ID for sending an action command. The request and response messages are associated with this value. The length should not exceed 32 characters.
codeIntegerbodyfalseThe code of a specified response. Valid values:
  • 0: success. This is the default value.
  • 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 returned result.
codeBooleanThe response code. It is empty when the operation succeeded.
msgStringThe error message if the API call fails. It is empty if the operation succeeded.
successBooleanIndicates whether the operation 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.