获取设备列表 v2

更新时间:2023-12-07 03:33:56下载pdf

本文介绍获取设备列表 v2的 API。

接口描述

批量获取设备列表。

接口地址

GET: /v2.0/devices

请求参数

参数名类型参数位置是否必填说明
device_idsStringqueryfalse设备 ID 列表,多个 ID 以半角逗号分隔
product_idStringqueryfalse产品 ID
schemaStringqueryfalseApp 应用标识
last_row_keyStringqueryfalse前一页返回的页面标识符
sizeIntegerquerytrue每页返回设备数量
start_update_timeLongqueryfalse根据设备的开始时间戳 update_time 查询(10 位)
end_update_timeLongqueryfalse根据设备的结束时间戳 update_time 查询(10 位)

返回参数

参数名类型说明
resultObj响应结果

result 说明

参数名类型说明
has_moreBoolean是否有下一页
last_row_keyString分页标识
totalLong总数
devicesList设备列表
last_idString设备最后查询 ID

请求示例

GET: /v2.0/devices?schema=testApp&last_row_key=xxxxx&size=20&start_update_time=13612321311&end_update_time=136123333223

返回示例

{
  "result": {
    "devices": [
      {
        "active_time": 1636597097,
        "biz_type": 0,
        "category": "qt",
        "create_time": 1636597097,
        "icon": "",
        "id": "6cf729298c4953e0f4****",
        "ip": "",
        "lat": "",
        "local_key": "115f466ea559****",
        "lon": "",
        "model": "",
        "name": "rbncbnrw3jpetcxm",
        "online": false,
        "owner_id": "4367****",
        "product_id": "rbncbnrw3jpe****
        "product_name": "我的空调(linkSDK三方设备)",
        "status": [],
        "sub": false,
        "time_zone": "+08:00",
        "uid": "bay1596435936771****",
        "update_time": 1638863657,
        "uuid": "tuyac11429d49505****"
      },
      {
        "active_time": 1636617682,
        "biz_type": 0,
        "category": "qt",
        "create_time": 1636617682,
        "icon": "",
        "id": "6cb4bd90f6cd6aba7c****",
        "ip": "",
        "lat": "",
        "local_key": "c9f4c26a287a****",
        "lon": "",
        "model": "",
        "name": "rbncbnrw3jpetcxm",
        "online": false,
        "owner_id": "43476130",
        "product_id": "rbncbnrw3jpe****",
        "product_name": "我的空调(linkSDK三方设备)",
        "status": [],
        "sub": false,
        "time_zone": "+08:00",
        "uid": "bay1596435936771****",
        "update_time": 1636646347,
        "uuid": "tuyae20f18249382****"
      },
      {
        "active_time": 1636355230,
        "biz_type": 0,
        "category": "qt",
        "create_time": 1636355230,
        "icon": "",
        "id": "6c871e364de7ace1a3****",
        "ip": "",
        "lat": "",
        "local_key": "6de4c80dc2df****",
        "lon": "",
        "model": "",
        "name": "rbncbnrw3jpetcxm",
        "online": false,
        "owner_id": "43476130",
        "product_id": "rbncbnrw3jpe****",
        "product_name": "我的空调(linkSDK三方设备)",
        "status": [],
        "sub": false,
        "time_zone": "+08:00",
        "uid": "bay1596435936771****",
        "update_time": 1636613296,
        "uuid": "tuyaa4be35dced28****"
      },
      {
        "active_time": 1636342515,
        "biz_type": 0,
        "category": "qt",
        "create_time": 1636342515,
        "icon": "",
        "id": "6c553a86446124dbba****",
        "ip": "",
        "lat": "",
        "local_key": "54cc0b2d80d6****",
        "lon": "",
        "model": "",
        "name": "rbncbnrw3jpetcxm",
        "online": false,
        "owner_id": "4347****",
        "product_id": "rbncbnrw3jpe****",
        "product_name": "我的空调(linkSDK三方设备)",
        "status": [],
        "sub": false,
        "time_zone": "+08:00",
        "uid": "bay1596435936771****",
        "update_time": 1636447374,
        "uuid": "tuya5411f0ba06aa****"
      },
      {
        "active_time": 1636342529,
        "biz_type": 0,
        "category": "qt",
        "create_time": 1636342529,
        "icon": "",
        "id": "6c2fcb04a323b4fdfc****",
        "ip": "",
        "lat": "",
        "local_key": "f5fbd1c2143d****",
        "lon": "",
        "model": "",
        "name": "rbncbnrw3jpetcxm",
        "online": false,
        "owner_id": "4347****",
        "product_id": "rbncbnrw3jpe****",
        "product_name": "我的空调(linkSDK三方设备)",
        "status": [],
        "sub": false,
        "time_zone": "+08:00",
        "uid": "bay1596435936771****",
        "update_time": 1636444084,
        "uuid": "tuya8f365a78ffd7****"
      }
    ],
    "has_more": false,
    "last_row_key": "A1B5D44724D34F879E33595E2771CB41",
    "total": 5
  },
  "success": true,
  "t": 1651904922248,
  "tid": "f0580568cdce11ecaac3bac49edea25c"
}

错误码

参考 错误码