Get Device Group

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

Based on the device ID, get all the groups that include the specified device ID.

API address

GET: /v2.0/cloud/thing/group/device/{device_id}

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringpathtrueThe device ID.

Return parameter

Parameter nameTypeDescription
resultJSONThe 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
idLongThe ID of the specified group.
nameStringThe name of the specified group.
pvStringThe version number of the specified MQTT protocol.
timeLongThe time when a group is created.
typeIntegerThe type of the specified group. Valid values:
  • 0: Devices that can be directly connected to the cloud.
  • 1:Devices that cannot be directly connected to the cloud, but can only be connected to the cloud through gateways.
uidStringThe ID of a user in the specified group.
categoryStringThe category code of the specified device.
dev_idStringThe device ID.
group_typeIntegerThe protocol type applicable to the specified group. Valid values:
  • 0: Wi-Fi
  • 1: Bluetooth low energy
  • 2: Zigbee
  • 3: Bluetooth mesh
icon_urlStringThe picture of the specified group. A product picture is used by default. Currently, you cannot change the product picture.
local_keyStringThe localKey used for the MQTT connection.
owner_idStringThe ID of the space to which the specified group belongs.
product_idStringThe ID of a product in the group.

Request example

GET: /v2.0/cloud/thing/group/device/1285**************

Return example

{
    "tid": "be27314ab32011edaa2fba12a1143bd9",
    "result": [
        {
            "icon_url": "https://images.tuyacn.com/smart/solution/15001/66ba22c327bfbf3d_co***.png",
            "standard": false,
            "dp_name": {
                "1": "",
                "9": ""
            },
            "local_key": "360f7d71088c*****",
            "dps": {
                "1": false,
                "9": 0
            },
            "owner_id": "251****",
            "pv": "2.2",
            "device_num": 1,
            "group_type": 0,
            "type": 0,
            "dev_id": "v2h3k1hkj1k****",
            "uid": "ay159910362****",
            "product_id": "fqi9xq***",
            "name": "Test****",
            "id": "1285****",
            "time": 1677117998,
            "category": "dj",
            "group_key": ""
        }
    ],
    "t": 1677118877539,
    "success": true
}

Error code

For more information, see error code.

Limits on API Request Frequency

For more information, see Limits on API Request Frequency.