Query Devices in Space

Last Updated on : 2024-09-10 01:49:14

Query the list of devices in the spaces on pages, based on the list of space IDs, product IDs, and product categories, as well as whether to recurse into subspaces.

API address

GET: /v2.0/cloud/thing/space/device

Request parameter

Parameter nameTypeINRequiredDescription
space_idsStringquerytrueThe list of up to 5 space IDs, separated with commas (,). This parameter cannot be empty.
is_recursionBooleanqueryfalseSpecifies whether to recurse into subspaces. Valid values:
  • true: Recurse into the subspaces to query device details.
  • false or empty: Query only devices in the current space, without recursion.
product_idsStringqueryfalseThe list of up to 5 product IDs, separated with commas (,).
categoriesStringqueryfalseThe list of up to 5 product categories, separated with commas (,).
last_idStringqueryfalseThe last device ID returned by the previous page. This parameter is not passed in case of the first page.
page_sizeIntegerquerytrueThe number of items returned on each page. Maximum value: 20.

Return parameter

Parameter nameTypeDescription
resultListThe list of returned data.
successBooleanIndicates whether the operation is successful. Valid values:
  • true: The operation succeeded.
  • false: The operation failed.
tLongThe timestamp.
tidStringThe link ID.

Description of result

Parameter nameTypeDescription
idStringThe device ID.
active_timeLongThe timestamp when the device was activated. Unit: seconds.
categoryStringThe product category of the specified device.
create_timeLongThe timestamp when the device was paired for the first time. Unit: seconds.
update_timeLongThe timestamp when the device was updated. Unit: seconds.
custom_nameStringThe custom name of the specified device.
iconStringThe icon of the specified device.
ipStringThe IP address of the specified device.
is_onlineBooleanIndicates whether a device is online.
latStringThe latitude of the specified device.
local_keyStringThe unique encrypted key of the specified device over LAN.
lonStringThe longitude of the specified device.
nameStringThe name of the specified device.
product_idStringThe product ID of the specified device.
product_nameStringThe product name of the specified device.
subBooleanIndicates whether the specified device is a sub-device.
time_zoneStringThe time zone in which the specified device is located.
uuidStringThe universally unique identifier (UUID) of the specified device.

Request example

GET: /v2.0/cloud/thing/space/device?space_ids=146323341***

Return example

{
    "tid": "a8bcb54fb8e411eda71e169efc83a172",
    "result": [
        {
            "sub": false,
            "create_time": 1659422574,
            "local_key": "06f4adf1e5fc4***",
            "ip": "124.90.34.***",
            "icon": "smart/icon/baydffaa6539efg/a6cdd065abcde3bfb689152eda***.png",
            "lon": "20.0641",
            "time_zone": "+8.0",
            "product_name": "Robot Vacuum A001",
            "uuid": "vdevo165abcd98***",
            "active_time": 1659422574,
            "update_time": 1659422574,
            "custom_name": "Robot Vacuum in Living Room",
            "product_id": "h9soglkuugftb***",
            "name": "Robot Vacuum-vdevo",
            "id": "vdevo165abcd98***",
            "is_online": true,
            "category": "cz",
            "lat": "50.3029"
        }
    ],
    "t": 1677752774750,
    "success": true
}

Error code

For more information, see error code.

Limits on API Request Frequency

For more information, see Limits on API Request Frequency.