Create Custom Group

Last Updated on : 2023-06-21 07:12:57download

Create a custom group, which belongs to the home group of the space by default.

API address

POST: /v1.0/iot-02/lighting/groups/package

Request parameter

Description of body

Parameter nameTypeINRequiredDescription
spaceIdStringbodytrueThe ID of a specified space.
nameStringbodytrueThe name of a specified group.
deviceIdsString[]bodytrueThe list of device IDs.
ownerIdStringbodyfalseThe ID of a specified home group.
groupConfigsStringbodyfalseThe extension parameter.

Return parameter

Parameter nameTypeDescription
groupPackageIdStringThe ID of a specified custom group.
taskIdStringThe number of device status. If the value of null is returned, the task is completed without showing the time-consuming operation.
expiredSecondslongThe remaining seconds before the task expires. If the value of null is returned, the task is completed without showing the time-consuming operation.
groupIdslong[]The list of device group IDs.

Request example

POST: /v1.0/iot-02/lighting/groups/package
{
  "spaceId": "146886924268113****",
  "name": "Custom Group 123467",
  "deviceIds": [
    "vdevo16393774893****",
    "vdevo16393775054****"
  ],
  "ownerId": "45360622",
  "groupConfigs": "test"
}

Return example

{
    "result": {
        "groupIds": [
            12089569,
            12089570
        ],
        "expiredSeconds": 14,
        "groupPackageId": "147566148209509****",
        "taskId": "147566148214961****"
    },
    "t": 1640660088966,
    "success": true
}

Error code

For more information, see error code.