Skip to content

Modify Scheduled Task

Interface Address:/v2/cep/enduserapi/v2/setCronJob

Request Method:PUT

Request Data Type:application/json

Response Data Type:*/*

Interface Description:Modify Scheduled Task

Request Example:

javascript
{
  "cacheTime": 0,
  "dayOfWeek": "",
  "dk": "",
  "enabled": true,
  "pk": "",
  "ruleId": "",
  "timeZone": "",
  "timers": [
    {
      "action": "",
      "cacheTime": 0,
      "delay": 0,
      "taskLogo": "",
      "taskName": "",
      "time": ""
    }
  ],
  "type": ""
}

Request Parameters:

Parameter NameParameter DescriptionRequest TypeRequiredData Typeschema
cmdcmdbodytrueModify Scheduled TaskModify Scheduled Task
  cacheTimeDownlink cache time, in seconds, value range: 0-7776000falseinteger(int32)
  dayOfWeekRepeat cycle: 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday, 7: Sunday, multiple separated by English commas, required when type = custom-repeatmulti-sectionrandom
  dkDevice Keytruestring
  enabledScheduled task status, enable: true, disable: falsefalseboolean
  pkProduct Keytruestring
  ruleIdScheduled task IDtruestring
  timeZoneTime zone. Format: +-HH:mmfalsestring
  timersScheduled task list, when type = multi-section, the number of scheduled tasks is limited to 2-5truearrayScheduled Task Req
    actionCommand executed by the scheduled task, format: Thing model JSON stringtruestring
    cacheTimeDownlink cache time, in seconds, value range: 0-7776000falseinteger
    delayDelayed execution time, in seconds, required when type = delayfalseinteger
    taskLogoTask iconfalsestring
    taskNameTask namefalsestring
    timeExecution time, format: HH:mm:ss, when type = onceday-repeatcustom-repeat
  typeScheduled task type, once: execute once, day-repeat: repeat daily, custom-repeat: repeat weekly, multi-section: multi-stage execution, delay: countdowntruestring
Authorizationheaderfalsestring

Response Status:

Status CodeDescriptionschema
200OKApiResult«Void»
201Created
401Unauthorized
403Forbidden
404Not Found
5066Please enter Product Key
5067Please enter Device Key
5107Please enter start time
5108Please enter end time
5109Start time format incorrect
5110End time format incorrect
5587Please enter scheduled task type
5588Scheduled task type parameter value out of range
5589Please enter command for scheduled task execution
5590Please enter which day of week to execute
5591Day of week parameter value out of range
5593Please enter scheduled task ID
5598Please enter execution time
5599Execution time parameter value out of range
5600Start time must be less than end time
5601Please enter delayed execution time
5602Delayed execution time parameter value out of range
5603Failed to modify scheduled task

Response Parameters:

Parameter NameParameter DescriptionTypeschema
codeinteger(int32)integer(int32)
extMsgstring
msgstring

Response Example:

javascript
{
	"code": 0,
	"extMsg": "",
	"msg": ""
}