Create Device Group

Last Updated on : 2023-06-15 05:50:20

Create a device group based on the device ID set and group name. Then, call the API operation of querying the group task information to check whether the task is successful based on the task ID.

API address

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

Request parameter

Description of body

Parameter nameTypeINRequiredDescription
group_nameString falseThe name of a specified group.
asset_idString falseThe ID of a specified asset.
device_idsList falseThe device ID.

Return parameter

Parameter nameTypeDescription
resultGroupPackageTaskVOThe task information about creating a group.

Description of result

Parameter nameTypeDescription
group_idStringThe ID of a specified group.
task_idStringThe ID of a specified task.
expire_timeLongThe expiration time in seconds.

Request example

POST:  /v1.0/iot-03/device-groups
{
  "group_name": "bulu-13n-test",
  "asset_id": "145248249804602****",
  "device_ids": [
    "6c9680b7****"
  ]
}

Return example

{
    "result": {
        "expired_seconds": 10,
        "task_id": "14057567104****",
        "group_id": "140511714560****"
    },
    "t": 1623846099825,
    "success": true
}

Error code

For more information, see error code.