Get Groups in a Space

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

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

API address

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

Request parameter

Description of body

Parameter nameTypeINRequiredDescription
space_idStringbodytrueThe ID of the specified space.
page_sizeIntegerbodytrueThe number of items to be returned per page.
page_noIntegerbodytrueThe 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 items 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 is created.
typeIntegerThe grouping type.
uidStringThe user ID.
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": "e36ef6c3b32111edaa2fba12a1143bd9",
    "result": {
        "count": 11,
        "page_number": 1,
        "dataList": [
            {
                "icon_url": "https://images.tuyacn.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插座-vdevo 群组",
                "id": 1285211,
                "time": 1676952415,
                "category": "",
                "group_key": ""
            }
        ],
        "page_size": 1
    },
    "t": 1677119365048,
    "success": true
}

Error code

For more information, see error code.