Query Devices in Space

Last Updated on : 2024-07-03 07:35:42download

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.
categoryStringThe product category of the specified device.
iconStringThe icon of the specified device.
ipStringThe IP address of the specified device.
latStringThe latitude where the device is located.
lonStringThe longitude where the device is located.
nameStringThe name of the specified device.
subBooleanIndicates whether the specified device is a sub-device.
uuidStringThe universally unique identifier (UUID) of the specified device.
activeTimeLongThe timestamp when the device was activated. Unit: seconds.
createTimeLongThe timestamp when the device was paired for the first time. Unit: seconds.
updateTimeLongThe timestamp when the device was updated. Unit: seconds.
customNameStringThe custom name of the specified device.
isOnlineBooleanIndicates whether the specified device is online.
localKeyStringThe unique encrypted key of the specified device over LAN.
productIdStringThe product ID of the specified device.
productNameStringThe product name of the specified device.
timeZoneStringThe time zone in which the specified device is located.

Request example

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

Return example

{
    "tid": "a8bcb54fb8e411eda71e169efc83a172",
    "result": [
        {
            "sub": false,
            "productId": "h9soglkuugftb***",
            "activeTime": 1659422574,
            "ip": "124.90.34.***",
            "icon": "smart/icon/baydffaa6539efg/a6cdd065abcde3bfb689152eda***.png",
            "timeZone": "+8.0",
            "customName": "Robot Vacuum in Living Room",
            "isOnline": true,
            "lon": "20.0641",
            "updateTime": 1659422574,
            "uuid": "vdevo165abcd98***",
            "productName": "Robot Vacuum A001",
            "createTime": 1659422574,
            "name": "Robot Vacuum-vdevo",
            "id": "vdevo165abcd98***",
            "category": "cz",
            "lat": "50.3029",
            "localKey": "06f4adf1e5fc4***"
        }
    ],
    "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.