Get Groups in Space

Last Updated on : 2024-06-29 02:12:08download

Based on the space ID, get a list of groups in the specified space.

API address

GET: /v2.0/cloud/thing/group

Request parameter

Parameter nameTypeINRequiredDescription
space_idStringquerytrueThe ID of the specified space.
page_sizeIntegerquerytrueThe number of entries to be returned per page.
page_noIntegerquerytrueThe current page number.

Return parameter

Parameter nameTypeDescription
resultSpaceDeviceGroupDTOThe 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
dataListListThe list of data.
countIntegerThe total number of returned entries.
page_sizeIntegerThe number of entries to be returned per page.
pag_numberIntegerThe current page number.

Description of dataList

Parameter nameTypeDescription
idLongThe ID of the specified group.
nameStringThe name of the specified group.
pvStringThe protocol version number.
timeLongThe time when a group was created.
typeIntegerThe grouping type.
uidStringThe ID of the specified user.
group_typeIntegerThe type of the specified group.
icon_urlStringThe picture of the specified group.
local_keyStringThe localKey used for the MQTT connection.
owner_idStringThe ID of the specified space.
product_idStringThe product ID (PID).

Request example

GET: /v2.0/cloud/thing/group?space_id=158170***&page_no=1&page_size=10

Return example

{
    "tid": "e36ef6c3b32111edaddddda1143bd9",
    "result": {
        "count": 11,
        "page_number": 1,
        "dataList": [
            {
                "icon_url": "https://images.tuyaus.com/smart/solution/15001/66ba22c327bfbf3d_co***.png",
                "standard": false,
                "dp_name": {
                    "1": "",
                    "9": ""
                },
                "local_key": "b74a3d9762a9f***",
                "dps": {
                    "1": false,
                    "9": 0
                },
                "owner_id": "25129***",
                "pv": "2.2",
                "device_num": 2,
                "group_type": 0,
                "type": 0,
                "dev_id": "",
                "product_ver": "1.0.0",
                "product_id": "fqi9xqldlmvpg***",
                "name": "Wi-Fi Socket-vdevo Group",
                "id": 1285211,
                "time": 1676952415,
                "category": "",
                "group_key": ""
            }
        ],
        "page_size": 1
    },
    "t": 1677119365048,
    "success": true
}

Error code

For more information, see error code.

Limits on API Request Frequency

For more information, see Limits on API Request Frequency.