English
English
简体中文
Contact Us
Register
Log In
Language
English
English
简体中文
Contact Us
Log In
Register
Go to main website
App Develop

App Development

Tuya provides multiple mobile app development methods such as no-code or IoT App SDK development to maximize the monetization of IoT apps.
layoutIndex

Device Management

Last Updated on : 2021-11-16 10:25:34download

This topic describes the basic service APIs of the device.

API list

Request method API Description
GET /v1.0/devices/{device_id} Get device details
GET /v1.0/users/{uid}/devices Get the device list of the user
GET /v1.0/devices Get the device list
PUT /v1.0/devices/{device_id}/functions/{function_code} Modify data point name
GET /v1.0/devices/{device_id}/logs Query device log
PUT /v1.0/devices/{device_id}/reset-factory Restore factory defaults
DELETE /v1.0/devices/{device_id} Delete the device by device ID
GET /v1.0/devices/{deviceId}/sub-devices Query the device list under the gateway
GET /v1.0/devices/factory-infos Query the factory information of the device
PUT /v1.0/devices/{device_id} Modify device name
POST /v1.0/devices/{device_id}/user Add a device user
DELETE /v1.0/devices/{device_id}/users/{user_id} Delete the specified user
PUT /v1.0/devices/{device_id}/users/{user_id} Modify the specified user
GET /v1.0/devices/{device_id}/users/{user_id} Query the information about the specified user
GET /v1.0/devices/{device_id}/users Query the list of users associated with the device
PUT /v1.0/devices/{device_id}/multiple-name Modify the multiple names
GET /v1.0/devices/{device_id}/multiple-names Get the multiple names

Get device details

API description

You can query the device details, including properties and the latest status of the device.

API address

GET /v1.0/devices/{device_id}

Request parameter

Parameter name Data type Parameter type Required Description
device_id String URI Yes Device ID

Return parameter

Parameter name Data type Description
code Integer Response code. See Error code.
success Boolean Determine whether the request succeeded or not.
  • true: succeeded
  • false: failed
msg String The message returned if the request fails. It will return null if the request succeeds.
result Object<result> The returned result.

Description of result

Parameter name Data type Description
id String Device number
name String Device name
uid String User ID
local_key String Key
category String Product category
product_id String Product ID
product_name String Product name
sub Boolean Determine whether it is a sub-device
  • true: yes
  • false: no
uuid String The unique device identifier
owner_id String Home ID
online Boolean Online status of the device
status Object<status> Functional status of the device
active_time Long Activation timestamp of the device in seconds
biz_type Long Apply business type
icon String Device icon
ip String Device IP

Description of status

Parameter name Data type Description
code String Data point code
value String Data point value
type String Type of the data point

Request example

GET /v1.0/devices/vdevo153490924188132

SDK example

TuyaClient client = new TuyaClient(clientId, secret, RegionEnum.CN);
DeviceVo deviceVo = client.getDeviceInfo(DEV_ID);
System.out.println("Get device information: ");
System.out.println(JSONObject.toJSONString(deviceVo));

Return example

{
    "success": true,
    "result": {
        "active_time": 1589505938,
        "biz_type": 299009,
        "category": "qt",
        "create_time": 1560827137,
        "icon": "smart/icon/15402589135gknz23xajb_0.png",
        "id": "60613135b121cddc294****",
        "ip": "120.198.****.****",
        "local_key": "3a9b50126fe473****",
        "name": "Body fat scale",
        "online": true,
        "owner_id": "1070****",
        "product_id": "g0er6hSKgMqr****",
        "product_name": "Wifi scales_OEM",
        "status": [
            {
                "code": "weight",
                "value": 48900
            },
            {
                "code": "left_hand_r",
                "value": 0
            },
            {
                "code": "right_hand_r",
                "value": 0
            },
            {
                "code": "left_leg_r",
                "value": 0
            },
            {
                "code": "right_leg_r",
                "value": 0
            },
            {
                "code": "body_r",
                "value": 653
            },
            {
                "code": "battery_low",
                "value": false
            }
        ],
        "sub": false,
        "time_zone": "+08:00",
        "uid": "ay157896239864843g****",
        "update_time": 1589764585,
        "uuid": "60613135b23cddc294****"
    }
}

Error code

The following are common service exceptions for this interface. For more exception errors, see Error Code.

Error code Description
500 System error
1106 Illegal permission

Get the device list of the user

API description

You can query the details about the operable devices of the user, including properties and the latest status of the device.

API address

GET /v1.0/users/{uid}/devices

Request parameter

Parameter name Data type Parameter type Required Description
uid String URI Yes Tuya user ID

Return parameter

Parameter name Data type Description
code Integer Response code. See Error code.
success Boolean Determine whether the request succeeded or not.
  • true: succeeded
  • false: failed
msg String The message returned if the request fails. It will return null if the request succeeds.
result Object<result> The returned result.

Description of result

Parameter name Data type Description
id String Device number
uid String User ID
local_key String Key
category String Product category
product_id String Product ID
sub Boolean Determine whether it is a sub-device
  • true: yes
  • false: No
uuid String The unique device identifier
owner_id String Device owner ID
online Boolean Online status of the device
name String Device name
ip String IP address
time_zone String Time zone
create_time Long The first network pairing time of the device
update_time Long The update time of device status
active_time Long The last pairing time of the device
status List<status> Functional status of the device

Description of status

Parameter name Data type Description
code String Data point code
value String Data point value

Request example

GET /v1.0/users/ay15xxxxxxxxxxx/devices

SDK example

TuyaClient client = new TuyaClient(clientId, secret, RegionEnum.CN);
List<DeviceVo> deviceFunctions = client.getUserDevices(UID);
System.out.println("Get the device list of the user: ");
System.out.println(JSONObject.toJSONString(deviceFunctions));

Return example

{
    "result":[
        {
            "sub":false,
            "create_time":1540691155,
            "local_key":"11a53bdd67e4****",
            "owner_id":"357****",
            "ip":"**.62.43.**",
            "biz_type":293964,
            "icon":"smart/product_icon/cz.png",
            "time_zone":"+08:00",
            "uuid":"27511006b4e62d4b****",
            "product_name":"Wi-Fi smart statistics socket",
            "active_time":1548584422,
            "uid":"ay1548569152777Q****",
            "update_time":1548584559,
            "product_id":"EvolhYPyZNWYPglE",
            "name":"xxx test",
            "online":true,
            "id":"27511006b4e62d4b****",
            "category":"cz",
            "status":[
                {
                    "code":"cur_power",
                    "value": 0
                },
                {
                    "code":"cur_voltage",
                    "value": 2196
                },
                {
                    "code":"switch",
                    "value": false
                },
                {
                    "code":"countdown_1",
                    "value": 0
                },
                {
                    "code":"cur_current",
                    "value": 0
                }
            ]
        }
    ],
    "t":1564996327422,
    "success":true
}

Error code

The following are common service exceptions for this interface. For more exception errors, see Error Code.

Error code Description
500 System error
1106 Illegal permission

Get the device list

API description

You can call this interface to query the device list by one of the following parameters: application, product, or device ID. You can get the relevant device data when the data permission dimension is either one of the following dimensions:

  • Application dimension The application dimension applies to a device purchaser. The device purchaser gets the device data by binding the application to the device. The application refers to an OEM app created on the IoT Platform or the app developed based on Tuya client SDK.

  • Product dimension The product dimension applies to a device manufacturer. The manufacturer creates a product on the Tuya IoT Platform, and produces the device based on the product (the device is connected to the Tuya Cloud). Finally, the manufacturer gets or controls the device data.

Note: The cloud API provides queries for activated real devices and virtual devices. It is not completely consistent with the query strategy of device management in the IoT Platform. Device management in the IoT Platform only provides real device queries. You can query the activated devices and deleted devices. The maximum query duration is 30 days, and it’s recommended to shorten the query interval based on the daily increase of devices for a quicker and more accurate query to avoid reaching the upper limit.

API address

GET /v1.0/devices

Request parameter

Parameter name Data type Parameter type Required Description
page_no Integer URI Yes Start page
page_size Integer URI Yes Page size
schema String URI No Application identifier
product_id String URI No Product ID
device_ids String URI No Device ID list
start_time String URI No Start time,10-bit timestamp
end_time String URI No End time,10-bit timestamp

Return parameter

Parameter name Data type Description
code Integer Response code. See Error code.
success Boolean Determine whether the request succeeded or not.
  • true: succeeded
  • false: failed
msg String The message returned if the request fails. It will return null if the request succeeds.
result Object<result> Return result

Description of result

Parameter name Data type Description
total Long Total
devices List<devices> Device list
last_id String The last queried device ID

Description of devices

Parameter name Data type Description
id String Device number
uid String User ID
local_key String Key
category String Product category
product_id String Product ID
sub Boolean Determine whether it is a sub-device
  • true: yes
  • false: No
uuid String The unique device identifier
owner_id String Device owner ID
online Boolean Online status of the device
name String Device name
ip String IP address
time_zone String Time zone
create_time Long The first network pairing time of the device
update_time Long The update time of device status
active_time Long The last pairing time of the device
status List<status> Functional status of the device

Description of status

参数名 类型 说明
code String Functional status code
value Object Functional status value (Regarding value, please refers to status value Doc, and value could be type of Boolean、Integer、String,please refers to the actual device)

Note: When the total amount of query data is too large, it is recommended to use the page\_size+last\_id combination, instead of the page\_size+page\_no combination. See the example for details.

Request example

GET /v1.0/devices?schema=testApp

GET /v1.0/devices?product_id=xxxxx

GET /v1.0/devices?device_ids=vdevo15xxxx88132,vdevo1xxx188132

GET /v1.0/devices?last_id=1584939489&page_size=20

SDK example

TuyaClient client = new TuyaClient(clientId, secret, RegionEnum.CN);
BatchDevices batchDevices = client.getDeviceListInfo(devIds);
System.out.println("Get device details in batches: ");
System.out.println(JSONObject.toJSONString(batchDevices));

Return example

{
    "result": {
        "devices": [
            {
                "active_time": 1584063323,
                "biz_type": 310002,
                "category": "znyxss",
                "create_time": 1575017570,
                "icon": "smart/program_category_icon/znyxss.png",
                "id": "747b2165d9449964****",
                "ip": "58.251.**.****",
                "local_key": "11d7f7286caa****",
                "model": "SS190",
                "name": "Wi-Fi smart speaker SS190",
                "online": false,
                "owner_id": "1160****",
                "product_id": "i9vkzktd",
                "product_name": "Wi-Fi smart speaker SS190",
                "status": [
                    {
                        "code": "smartspeaker_vol",
                        "value": "26"
                    },
                    {
                        "code": "smartspeaker_mic",
                        "value": "true"
                    },
                    {
                        "code": "smartspeaker_play",
                        "value": "false"
                    },
                    {
                        "code": "smartspeaker_wm_switch",
                        "value": "btm"
                    },
                    {
                        "code": "smartspeaker_bt_switch",
                        "value": "false"
                    },
                    {
                        "code": "smartspeaker_pre",
                        "value": "false"
                    },
                    {
                        "code": "smartspeaker_next",
                        "value": "false"
                    },
                    {
                        "code": "smartspeaker_play_mode",
                        "value": "random"
                    },
                    {
                        "code": "smartspeaker_alarm_clock",
                        "value": ""
                    },
                    {
                        "code": "smartspeaker_alert",
                        "value": ""
                    },
                    {
                        "code": "ir_send",
                        "value": "{\"control\":\"study_exit\"}"
                    },
                    {
                        "code": "ir_study_code",
                        "value": ""
                    }
                ],
                "sub": false,
                "time_zone": "+08:00",
                "uid": "ay156531946658X****",
                "update_time": 1584939489,
                "uuid": "12****"
            }
        ],
        "last_id": "158493****",
        "total": 1
    },
    "success": true,
    "t": 1586741851210
}

Error code

The following are common service exceptions for this interface. For more exception errors, see Error Code.

Error code Description
500 System error
1106 Illegal permission

Modify data point name

API description

You can modify the names of multiple sub-devices.

API address

PUT /v1.0/devices/{device_id}/functions/{function_code}

Request parameter

Parameter name Data type Parameter location Required Description
device_id String URI Yes Device ID
function_code String URI Yes Data point
name String Body Yes Data point name

Request example

PUT /v1.0/devices/vdevo156083035305868/functions/switch_1

{
  "name":"lalal"
}

Return parameter

Parameter name Data type Description
code Integer Response code. See Error code.
success Boolean Determine whether the request succeeded or not.
  • true: succeeded
  • false: failed
msg String The message returned if the request fails. It will return null if the request succeeds.
result Object Return result
t Long Timestamp

Return example

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

Query device log

API description

Query the device operation history according to the query criteria.

API address

GET /v1.0/devices/{device_id}/logs

Request parameter

Parameter name Data type Parameter location Required Description
device_id String URI Yes Device ID
type String URL Yes The supported log query type. Query multiple event types, which are separated by half-width comma (,). It is a required parameter. For more information, see Description of event types.
start_time Long URL Yes the 13 bit start timestamp of the query. If it is 0 or empty, it will be automatically set to the time stamp nearly 7 days ago. start_time is recommended Set the query time a little larger to avoid the timeout caused by querying too much data at a time.
end_time Long URL Yes the 13 bit end timestamp of the query
codes String URL No Data points supported by the device. Query multiple data points, which are separated by half-width comma (,). It is empty by default.
start_row_key String URL No A parameter of the free edition. Query the row key of Hbase. The default value is empty.
last_row_key String URL No Required in the paid edition. Pagination parameter of the paid edition. It is the row key of the last piece of data. Query the first page when it is empty.
last_event_time Long URL No Required in the paid edition. Pagination parameter of the paid edition. The event occurrence time of the last piece of data. Query the first page when it is empty.
size int URL No The number of logs to be queried. It is 20 by default.
query_type Integer URL No Query type. It is 1 by default.
  • 1: free edition
  • 2: paid edition

Request example

  • Example of free edition
{{url}}/v1.0/devices/78304402ecfabc1fd5b2/logs?start_row_key=&type=1,2&start_time=0&end_time=1545898159935&size=20
  • Example of paid edition
GET /v1.0/devices/03200026dc4f221b6d6d/logs?type=7&start_time=0&end_time=1545898159935&size=20&query_type=2&last_row_key=650823455f68a9cbafce08700557_9223370475075511414_1&last_event_time=1561779264393

Return parameter

Parameter name Data type Description
code Integer Response code. See Error code.
success Boolean Determine whether the request succeeded or not.
  • true: succeeded
  • false: failed
msg String The message returned if the request fails. It will return null if the request succeeds.
result Object<result> Return result
t Long Timestamp

Description of result

Parameter name Data type Description
logs Object<logs> Log message body.
has_next Boolean Specify whether there is still another message.
device_id String Device ID.
current_row_key String A parameter of the free edition. The current row key of Hbase.
next_row_key String A parameter of the free edition. The next row key of Hbase that meets the query criteria.
Note: If it returns null, it means that the next log does not meet the query criteria.
count Long A parameter of the paid edition. The total number of logs that meet the query criteria.

Description of logs

Parameter name Data type Description
code String Data point code
value String Data point value
event_time String Timestamp of the event occurrence
event_from String The source of the event trigger. See Event source description.
event_id String The event type. See Event type description.
status String The data is valid and has not been deleted. It is 1 by default.
row String A parameter of the paid edition. It is the current row key of Hbase.

Return example

  • Return example of success

    • Free edition
    {
    "success": true,
    "t": 1561344464370,
    "result": {
        "logs": [
            {
                "code": "switch_1",
                "value": "false",
                "event_time": 1560872567955,
                "event_from": "1",
                "event_id": 7
            },
            {
                "code": "switch_1",
                "value": "false",
                "event_time": 1560783276382,
                "event_from": "1",
                "event_id": 7
            }
        ],
        "device_id": "75500780ecfabc9a****",
        "has_next": true,
        "current_row_key": "NjUwODIzNDU1ZjY4YTljYmFmY2UwODcwMDU1N185MjIzMzcwNDc1OTgyMjA3ODUyXzdfMQ==",
        "next_row_key": "NjUwODIzNDU1ZjY4YTljYmFmY2UwODcwMDU1N185MjIzMzcwNDc2MDcxNDk5OTM0XzdfMQ=="
    	}
    }
    
    • Paid edition
    {
    "success":true,
        "t":1561344464370,
        "result":{
            "count":32,
            "device_id":"75500780ecfabc9a****",
            "has_next":true,
            "logs":[
                {
                    "event_id":1,
                    "event_time":1562031576431,
                    "event_from":"1",
                    "row":"650823455f68a9cbafce08700557_9223370474823199376_1",
                    "status":"1"
                },
                {
                    "event_id":1,
                    "event_time":1562031394665,
                    "event_from":"1",
                    "row":"650823455f68a9cbafce08700557_9223370474823381142_1",
                    "status":"1"
                },
                {
                    "event_id":1,
                    "event_time":1562031277824,
                    "event_from":"1",
                    "row":"650823455f68a9cbafce08700557_9223370474823497983_1",
                    "status":"1"
                },
                {
                    "event_id":1,
                    "event_time":1561935500636,
                    "event_from":"1",
                    "row":"650823455f68a9cbafce08700557_9223370474919275171_1",
                    "status":"1"
                }
            ]
        }
    }
    
  • Return example of failure

	{
    "success": false,
    "code": 2009,
    "msg": "not support this device",
    "t": 1561348644346
	}

Event source description

code Description
1 Device
2 Instruction from the client
3 Third-party platform
4 Instruction from the cloud
-1 Unknown

Event type description

code Description
1 Go online
2 Go offline
3 Activate the device
4 Reset the device
5 Send an instruction
6 Upgrade firmware
7 Report the data point
8 Device semaphore
9 Reboot the device
10 Timing information

Restore factory defaults

API description

Restore the factory defaults by device ID.

API address

PUT /v1.0/devices/{device_id}/reset-factory

Request parameter

Parameter name Data type Required Description
device_id String Yes Device ID

Request example

PUT /v1.0/devices/6c362ac3c53fbd6f3ewqfa/reset-factory

Return parameter

Parameter name Data type Description
code Integer Response code. See Error code.
success Boolean Determine whether the request succeeded or not.
  • true: succeeded
  • false: failed
msg String The message returned if the request fails. It will return null if the request succeeds.
result Boolean The returned result.

Return example

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

Delete a device

API description

Delete the device by the device ID.

API address

DELETE /v1.0/devices/{device_id}

Request parameter

Parameter name Data type Required Description
device_id String Yes Device ID

Request example

DELETE /v1.0/devices/6c362ac3c53fbd6f3ewqfa

Return parameter

Parameter name Data type Description
code Integer Response code. See Error code.
success Boolean Determine whether the request succeeded or not.
  • true: succeeded
  • false: failed
msg String The message returned if the request fails. It will return null if the request succeeds.
result Boolean The returned result.

Query the device list under the gateway

API description

Query the device list under the gateway.

API address

GET /v1.0/devices/{deviceId}/sub-devices

Request parameter

Parameter name Data type Parameter type Required Description
device_id String URI Yes Device ID

Return parameter

Name Data type Description
t Long Timestamp
success Boolean Whether the request succeeded or not.
result List<result> Result

Description of result

Parameter name Parameter type Description
id String Device ID
name String Device name
online Boolean Online status
owner_id Long Home ID
category Integer Data type
product_id Integer Product
active_time String Activation time
update_time String Update time

Request example

GET /v1.0/devices/vedeo16236124/sub-devices

Return example

{
     "result": [
         {
             "active_time": 1586169374,
             "category": "sj",
             "id": "6c0746cfe887e21e8b****",
             "name": "Water leakage detector",
             "online": true,
             "owner_id": "1059****",
             "product_id": "rzeSU2h9uoklxEwq",
             "update_time": 1586169379
         }
     ],
     "success": true,
     "t": 1586169580204
 }

Error code

The following are common service exceptions for this interface. For more exception errors, see Error Code.

Error code Description
500 System error

Query the factory information of the device

API description

Query the factory information of the device.

API address

GET /v1.0/devices/factory-infos

Request parameter

Parameter name Data type Parameter type Required Description
device_ids String URL Yes Device ID, separated by commas

Return parameter

Name Data type Description
t Long Timestamp
success Boolean Whether the request succeeded or not.
result List<result> Result

Description of result

Parameter name Parameter type Description
id String Device ID
uuid String Device name
sn String Serial number of the device
mac String MAC address of the device

Request example

GET /v1.0/devices/factory-infos?device_ids=002008535ccf7f53****

Return example

{
    "result": [
        {
            "id": "002008535ccf7f53****",
            "mac": "5c:cf:7f:53:**:**",
            "uuid": "002008535ccf7f53****"
        }
    ],
    "success": true,
    "t": 1585619435816
}

Error code

The following are common service exceptions for this interface. For more exception errors, see Error Code.

Error code Description
500 System error

Modify device name

Modify device name

API address

PUT /v1.0/devices/{device_id}

Request parameter

Parameter name Data type Parameter type Required Description
device_id String URI Yes Device ID
name String BODY Yes Name

Return parameter

Name Data type Description
t Long Timestamp
success Boolean Whether the request succeeded or not.
result Boolean Result

Request example

PUT /v1.0/devices/vedeo234567
{
    "name":""
}

Return example

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

Error code

The following are common service exceptions for this interface. For more exception errors, see Error Code.

Error code Description
500 System error

Add a user

API address

POST /v1.0/devices/{device_id}/user

Request parameter

Parameter name Parameter type Required Description
device_id String Yes Device ID
nick_name String Yes Username
sex Integer Yes Gender
  • 1: male
  • 2: female
birthday Long No Date of birth (day, month, year)
height Integer No Height (cm)
weight Integer No Weight (g)
contact String No Contact info

Return parameter

Name Data type Description
t Long Return time
success Boolean Whether the request succeeded or not.
result String The added user ID

Request example

POST /v1.0/devices/vedeo787322q/user

{
    "nick_name": "test",
    "sex": 1
}

Return example

{
    "t":1564996327422,
    "success":true,
    "result": "5121231"
}

Error code

The following are common service exceptions for this interface. For more exception errors, see Error Code.

Error code Description
500 System error

Modify a user

API address

PUT /v1.0/devices/{device_id}/users/{user_id}

Request parameter

Parameter name Parameter type Required Description
device_id String Yes Device ID
user_id String Yes The added user ID
nick_name String Yes Username
sex Integer Yes Gender
  • 1: male
  • 2: female
birthday Long No Date of birth (day, month, year)
height Integer No Height (cm)
weight Integer No Weight (g)

Return parameter

Name Data type Description
t Long Timestamp
success Boolean Whether the request succeeded or not.
result Object Result

Request example

PUT /v1.0/devices/vedeo16236124/users/12445765

{
    "nick_name": "",
    "sex": 1,
    "birthday": 1544996327422,
    "height": 178,
    "weight": 160
}

Return example

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

Error code

The following are common service exceptions for this interface. For more exception errors, see Error Code.

Error code Description
500 System error

Delete a user

API address

DELETE /v1.0/devices/{device_id}/users/{user_id}

Request parameter

Parameter name Parameter type Required Description
device_id String Yes Device ID
user_id String Yes User ID

Return parameter

Name Data type Description
t Long Timestamp
success Boolean Whether the request succeeded or not.
result Boolean Result

Request example

DELETE /v1.0/devices/vedeo16236124/users/5232342

Return example

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

Error code

The following are common service exceptions for this interface. For more exception errors, see Error Code.

Error code Description
500 System error

Query user information

API address

GET /v1.0/devices/{device_id}/users/{user_id}

Request parameter

Parameter name Parameter type Required Description
device_id String Yes Device ID
user_id String Yes User ID

Return parameter

Name Data type Description
t Long Timestamp
success Boolean Whether the request succeeded or not.
result Object Result

Description of result

Parameter name Parameter type Description
device_id String Device ID
nick_name String Username
sex Integer Gender
  • 1: male
  • 2: female
birthday Long Date of birth (day, month, year)
height Integer Height (cm)
weight Integer Weight (g)
contact String Contact info

Request example

GET /v1.0/devices/vedeo16236124/users/5232342

Return example

{
    "t":1564996327422,
    "success":true,
    "result": 
      {
        "device_id": "vedeo1623****",
        "nick_name": "",
        "sex": 1,
        "birthday": 1544996327422,
        "height": 178,
        "weight": 160,
        "contact": ""
      }
}

Error code

The following are common service exceptions for this interface. For more exception errors, see Error Code.

Error code Description
500 System error

Query user information by device ID

API address

GET /v1.0/devices/{device_id}/users

Request parameter

Parameter name Parameter type Required Description
device_id String Yes Device ID

Return parameter

Name Data type Description
t Long Timestamp
success Boolean Whether the request succeeded or not.
result List<result> Result

Description of result

Parameter name Parameter type Description
device_id String Device ID
nick_name String Username
sex Integer Gender
  • 1: male
  • 2: female
birthday Long Date of birth (day, month, year)
height Integer Height (cm)
weight Integer Weight (g)
contact String Contact info

Request example

GET /v1.0/devices/vedeo16236124/users

Return example

{
    "t":1564996327422,
    "success":true,
    "result": [
      {
        "device_id": "vedeo1623****",
        "nick_name": "",
        "sex": 1,
        "birthday": 1544996327422,
        "height": 178,
        "weight": 160,
        "contact": ""
      }
    ]
}

Error code

The following are common service exceptions for this interface. For more exception errors, see Error Code.

Error code Description
500 System error

Modify the multiple names

When a device has multiple names, you can modify the multiple names. Currently, it applies to power strips.

API address

PUT /v1.0/devices/{device_id}/multiple-name

Request parameter

Parameter name Data type Parameter type Description Required
device_id String URI Yes Device ID
identifier String BODY Yes Identifier
name String BODY Yes Name

Return parameter

Name Data type Description
t Long Timestamp
success Boolean Whether the request succeeded or not.
result Boolean Result

Request example

PUT /v1.0/devices/vedeo234567/multiple-name
{
    "identifier":"",
    "name":""
}

Return example

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

Error code

The following are common service exceptions for this interface. For more exception errors, see Error Code.

Error code Description
500 System error

Get the multiple names

Get the multiple names of the device.

API address

GET /v1.0/devices/{device_id}/multiple-names

Request parameter

Parameter name Data type Parameter type Required Description
device_id String URI Yes Device ID

Return parameter

Name Data type Description
t Long Timestamp
success Boolean Whether the request succeeded or not.
result List Result

Description of result

Name Data type Description
identifier String Identifier
name String Name

Request example

GET /v1.0/devices/vedeo234567/multiple-name

Return example

{
    "t":1234876331,
    "success":true,
    "result": [
    {
        "identifier":"",
        "name":""
    }]
}

Error code

The following are common service exceptions for this interface. For more exception errors, see Error Code.

Error code Description
500 System error