Query Scheduled Task

Last Updated on : 2023-07-25 05:58:03download

Query the details of scheduled tasks under the specified device.

API address

GET: /v2.0/cloud/timer/device/{device_id}

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringpathtrueThe device ID.
timer_idsStringqueryfalseThe ID of the specified scheduled task. Multiple IDs are separated with commas (,).
categoryStringqueryfalseThe category of the specified scheduled task.

Return parameter

Parameter nameTypeDescription
resultListThe returned result.

Description of result

Parameter nameTypeDescription
time_idStringThe ID of the specified scheduled task.
alias_nameStringThe alias of the specified scheduled task.
timeStringThe time when the specified scheduled task is run.
timezone_idStringThe ID of the specified time zone. Example: Asia/Shanghai.
dateStringThe date when the specified scheduled task is run.
loopsStringIf a request failed, the return value is a seven-digit number consisting of 0 and 1. 0 indicates that the scheduled task is disabled, and 1 indicates that the scheduled task is enabled. For example, 0000001 means that the scheduled task is disabled on Sunday, Monday, Tuesday, Wednesday, Thursday, and Friday, and enabled on Saturday.
functionsListThe command to be executed at the specified time.
enableBooleanSpecifies whether a scheduled task is enabled. Valid values:
  • true: The scheduled task is enabled.
  • false: The scheduled task is disabled.

Description of functions

Parameter nameTypeDescription
codeStringThe code of the specified command to be executed.
valueobjectThe value of the specified command to be executed.

Request example

GET: /v2.0/cloud/timer/device/6ccb7dc348af04ad****?timer_ids=1****

Return example

{
    "tid": "dcae3f8bd1f811ed9aa2525400d49d82",
    "result": [
        {
            "date": "00000000",
            "functions": [
                {
                    "code": "switch_1",
                    "value": true
                }
            ],
            "loops": "1111111",
            "alias_name": "Test 1-3",
            "timer_id": "1****",
            "timezone_id": "Asia/Shanghai",
            "time": "14:52"
        }
    ],
    "t": 1680510230386,
    "success": true
}

Error code

For more information, see error code.

Limits on API Request Frequency

For more information, see Limits on API Request Frequency.