Query Group Task Progress

Last Updated on : 2024-06-29 02:32:45download

Query the task progress of the specified group based on the group ID and task ID.

API address

GET: /v2.1/cloud/thing/group/task/{group_id}/{task_id}

Request parameter

Parameter nameTypeINRequiredDescription
group_idLongpathtrueThe group ID.
task_idLongpathtrueThe task ID.

Return parameter

Parameter nameTypeDescription
resultJsonObjectThe returned result of the specified group.
successBooleanIndicates whether the API is called successfully. Valid values:
  • true: The API call succeeded.
  • false: The API call failed.
tLongThe timestamp.
tidStringThe link ID.

Description of result

Parameter nameTypeDescription
group_idLongThe group ID.
task_idStringThe task ID.
task_typeIntegerThe type of tasks. Valid values:
  • 1: Add. For example, create a group.
  • 2: Update. For example, add a device to a group or remove a device from a group.
  • 3: Delete. For example, delete a group.
success_devicesListThe list of devices that have successfully joined or been removed from the specified group.
failed_devicesListThe list of devices that failed to join a group, failed to remove from a group, do not support group functionality, and are offline.
operating_devicesListThe list of devices that are not being operated or are still being operated.

Description of operating_devices

Parameter nameTypeDescription
device_idStringThe device ID.
actionIntegerThe type of operation. Valid values:
  • 0: Add the device to the group.
  • 1: Remove the device from the group.
operate_statusIntegerThe operation status. Valid values:
  • -1: No operation.
  • -2: The operation is in progress.

Description of failed_devices

Parameter nameTypeDescription
device_idStringThe device ID.
actionIntegerThe type of operation. Valid values:
  • 0: Add the device to the group.
  • 1: Remove the device from the group.
operate_statusIntegerThe operation status. Valid values:
  • 1: The upper limit of devices to be added has been exceeded.
  • 2: The sub-device timed out.
  • 3: The specified value was out of range.
  • 4: An error occurred while writing to files.
  • 5: Other errors.
  • -3: The device timed out while returning a result.
  • -4: The device does not support grouping and cannot join the group.
  • -5: The device is offline and cannot join the group.

Description of success_devices

Parameter nameTypeDescription
device_idStringThe device ID.
actionIntegerThe type of operation. Valid values:
  • 0: Add the device to the group.
  • 1: Remove the device from the group.
operate_statusIntegerThe operation status.
  • 0: The operation succeeded.

Request example

GET: /v2.1/cloud/thing/group/task/1393****/178304019638051****

Return example

{
    "tid": "b0d2f182022211efbe7a366d87620758",
    "result": {
        "operating_devices": [
        ],
        "failed_devices": [
        ],
        "task_id": "1783040196380512***",
        "success_devices": [
            {
                "device_id": "vdevo17059963185****",
                "operate_status": 0,
                "action": 0
            },
            {
                "device_id": "vdevo17059963113****",
                "operate_status": 0,
                "action": 0
            }
        ],
        "group_id": 13931111,
        "task_type": 1
    },
    "t": 1713953349341,
    "success": true
}

Error code

For more information, see error code.

Limits on API Request Frequency

For more information, see Limits on API Request Frequency.