Group Management API-V1

create device group

POST {host}/1.0/group

create a new device group, you can only create up to 50 groups.

Request Body

Name
Type
Description

name

string

custom group name

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

Example request

curl --request POST \
     --url '{host}/1.0/group' \
     --user '<username>:<password>' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --data '{"name":"device group name"}' \
     --include

list device group

GET {host}/1.0/lists/group

get the list of all groups

{
    "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}/1.0/lists/group' \
     --user '<username>:<password>' \
     --include

list device group with devices

GET {host}/1.0/lists/group/devices

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.

{
    "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",
                    "battery_status": "2"
                }
            ]
        },
        {
            "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}/1.0/lists/group/devices' \
     --user '<username>:<poassword>' \
     --header 'content-type: application/json' \
     --include

Last updated