Enable/Disable Scheduled Task

Last Updated on : 2023-07-25 05:56:46download

Enable or disable a scheduled task of the specified device.

API address

PUT: /v2.0/cloud/timer/device/{device_id}/state

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringpathtrueThe device ID.

Description of body

Parameter nameTypeINRequiredDescription
timer_idStringbodytrueThe ID of the specified scheduled task.
enableBooleanbodytrueThe status of the specified scheduled task. Valid values:
  • true: The scheduled task is enabled.
  • false: The scheduled task is disabled.

Return parameter

Parameter nameTypeDescription
resultBooleanThe returned result.

Request example

PUT: /v2.0/cloud/timer/device/6ccb7dc348****/state
{
  "timer_id": "2****",
  "enable": true
}

Return example

{
    "tid": "bd6ad6f3d1f311ed87a3525400d83734",
    "result": true,
    "t": 1680508033221,
    "success": true
}

Error code

For more information, see error code.

Limits on API Request Frequency

For more information, see Limits on API Request Frequency.