Add Industrial Device

Last Updated on : 2022-04-02 09:00:45download

Add the data of an industrial device that is connected to Tuya's IoT cloud services.

API address

POST: /v1.1/iot-03/si/devices

Request parameter

Description of body

Parameter nameTypeINRequiredDescription
tuya_device_idString trueThe ID of a Tuya device.
device_codeString trueThe unique code of a specified device.
device_nameString trueThe device name.
device_type_codeString trueThe code of a specified device type.
device_model_codeString trueThe code of a specified device model.
customer_codeString falseThe code of a specified customer.
production_timeLong falseThe production time.
batch_numberString falseThe device batch number.
sale_timeLong falseThe sales time.
sale_addressString falseThe detailed sales address.
sale_longitudeString falseThe longitude of a specified sales address.
sale_latitudeString falseThe latitude of a specified sales address.
real_time_positioningBoolean falseIndicates whether the device can be located in real time.
device_propertiesList falseThe special attributes of a specified device.

Description of device_properties

Parameter nameTypeINRequiredDescription
nameString falseThe name of a specified attribute.
codeString falseThe code of a specified attribute.
valueString falseThe value of a specified attribute.

Return parameter

Parameter nameTypeDescription
resultBooleanThe returned result.

Request example

POST: /v1.1/iot-03/si/devices
  "tuya_device_id": "vdevo******",
  "device_code": "C1",
  "device_name": "Machine Tool",
  "device_type_code": "mac",
  "device_model_code": "mac001",
  "customer_code": "VIP001",
  "production_time": 1637204299000,
  "batch_number": "1",
  "sale_time": 1637204299000,
  "sale_address": "Zhejiang***",
  "sale_longitude": "12****",
  "sale_latitude": "3*****",
  "real_time_positioning": true,
  "device_properties": [
      "name": "Height",
      "code": "high",
      "value": "300"

Return example

    "result": true,
    "t": 1634648181838,
    "success": true

Error code

For more information, see error code.