create a new device group

POST
{host}/group/create_group
create a new device group, you can only create up to 50 groups.
Body Parameters
name
(required)
string
custom group name

response

{
    "code": "0",
    "data": {
        "org_id": "1411841915123",
        "name": "test group22",
        "unique_name": "1B86514936880D18",
        "created": "1587690584174"
    }
}

Example request

curl --request POST \
     --url '{host}/group/create_group' \
     --user '<username>:<password>' \
     --header 'Content-Type: application/json; charset=utf-8' \
     --data '{"name":"device group name"}' \
     --include

list device group

GET
{host}/group/list_group_nodes
get the list of all groups

response

{
    "code": "0",
    "data": [
        {
            "group_name": "Default",
            "group_unique_name": "",
            "nodes": [
                {
                    "dev_eui": "2CF7F12003900000",
                    "dev_name": "TEST",
                    "lon": "113.9291658",
                    "lat": "22.5710348",
                    "online_status": "0",
                    "battery_status": "2"
                },
                {
                    "dev_eui": "2CF7F12104700011",
                    "dev_name": "US915-2CF7F12104700011",
                    "lon": "113.926979",
                    "lat": "22.573724",
                    "online_status": "0", // "0" offline, "1" online
                    "battery_status": "2" // "0" battery low power, "1" battery power OK
                }
            ]
        },
        {
            "group_name": "demo",
            "group_unique_name": "00452831720DCA8A",
            "nodes": [
                {
                    "dev_eui": "2CF7F1201350001A",
                    "dev_name": "2CF7F1201350001A",
                    "lon": "111.304984",
                    "lat": "26.15868",
                    "online_status": "0",
                    "battery_status": "2"
                }
            ]
        }
    ]
}

Example request

curl --request GET \
     --url '{host}/group/list_group_nodes' \
     --user '<username>:<password>' \
     --include

list device group with devices

GET
{host}/group/list_group_statistic
List all groups and devices in each group

The Default group is a virtual group, its group_unique_name is empty. All devices will be claimed into the Default group, users could then reorganize them with different groups.

response

{
    "code": "0",
    "data": {
        "page": {
            "count": "12"
        },
        "list": [
            {
                "name": "Default",
                "group_unique_name": "",
                "created": "0",
                "dev_cnt": "62",
                "online_cnt": "1"
            },
            {
                "created": "1553573458000",
                "name": "雅安茶园",
                "group_unique_name": "52975E5A7C2C396A",
                "dev_cnt": "7",
                "online_cnt": "0"
            }
        ]
    }
}

Example request

curl --request GET \
     --url '{host}/group/list_group_statistic' \
     --user '<username>:<poassword>' \
     --header 'content-type: application/json' \
     --include