Get Device List v2

Last Updated on : 2023-12-07 03:33:56download

Get a list of multiple devices.

API address

GET: /v2.0/devices

Request parameter

Parameter nameTypeINRequiredDescription
device_idsStringqueryfalseThe list of device IDs, separated with commas (,).
product_idStringqueryfalseThe ID of a specified product.
schemaStringqueryfalseThe schema of a specified app.
last_row_keyStringqueryfalseThe key of the last row.
sizeIntegerquerytrueThe number of entries returned per page.
start_update_timeLongqueryfalseThe 10-digit start timestamp of a specified time period in which the status of a device is updated.
end_update_timeLongqueryfalseThe 10-digit end timestamp of a specified time period in which the status of a device is updated.

Return parameter

Parameter nameTypeDescription
resultObjThe returned result.

Description of result

Parameter nameTypeDescription
has_moreBooleanSpecifies whether there is a next page.
last_row_keyStringThe key of the last row.
totalLongThe total number of entries.
devicesListThe list of returned devices.
last_idStringThe last query ID of a specified device.

Request example

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

Return example

{
  "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": "My Air Conditioner (LinkSDK-based third-party device)",
        "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": "My Air Conditioner (LinkSDK-based third-party device)",
        "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": "My Air Conditioner (LinkSDK-based third-party device)",
        "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": "My Air Conditioner (LinkSDK-based third-party device)",
        "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": "My Air Conditioner (LinkSDK-based third-party device)",
        "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"
}

Error code

For more information, see error code.