Get Device Group List

Last Updated on : 2023-07-06 07:53:09download

Get a list of device groups on pages.

API address

GET: /v1.0/iot-03/device-groups

Request parameter

Parameter nameTypeINRequiredDescription
reqGroupPackageQueryReqqueryfalseThe input parameters.

Description of req

Parameter nameTypeINRequiredDescription
group_nameString falseThe name of a specified group.
asset_idString falseThe ID of a specified asset.
asset_idsString falseThe asset IDs.
page_noInteger falseThe page number.
page_sizeInteger falseThe number of items returned on each page.

Return parameter

Parameter nameTypeDescription
resultBasePageVOThe returned result.

Description of result

Parameter nameTypeDescription
has_moreBooleanSpecifies whether to return the next page.
totalLongThe total number of groups.
listListThe list of groups.

Description of list

Parameter nameTypeDescription
group_idStringThe ID of a specified group.
group_nameStringThe name of a specified group.
create_timeLongThe time when it is created.
update_timeLongThe time when it is updated.
processing_statusIntegerThe execution status of a specified task. Valid values:
  • 0: Devices are being added to the group or removed from the group.
  • 1: The adding/removal operation of all devices is successful.
  • 2: The adding/removal operation of some devices is successful.
  • 3: The adding/removal operation of all devices failed.
asset_idStringThe ID of a specified asset.

Request example

GET: /v1.0/iot-03/device-groups?pageNo=1&pageSize=2

Return example

{
    "result": {
        "list": [
            {
                "create_time": 1623208592,
                "group_name": "test_group1111",
                "update_time": 1623324050,
                "group_id": "14024642592****"
            },
            {
                "create_time": 1623223232,
                "group_name": "group_test",
                "update_time": 1623223232,
                "group_id": "14025071296****"
            },
            {
                "create_time": 1623208448,
                "group_name": "group_test",
                "update_time": 1623208448,
                "group_id": "140246945728****"
            },
            {
                "create_time": 1623153892,
                "group_name": "group_test",
                "update_time": 1623153892,
                "group_id": "140223887040****"
            },
            {
                "create_time": 1623152145,
                "group_name": "group_test",
                "update_time": 1623152145,
                "group_id": "140228183552****"
            }
        ],
        "total": 14,
        "has_more": true
    },
    "t": 1623827448052,
    "success": true
}

Error code

For more information, see error code.