Edit a cron job.
token
(Required)id
(Required)url
(Optional)cron_expression
(Optional)timezone_from
(Optional)1
use the timezone in your EasyCron account.2
use the timezone in the cron job.timezone
(Ignored if timezone_from == 1. Required if timezone_from == 2)cron_job_name
(Optional)description
(Optional)auth_user
(Optional)auth_pw
(Optional)custom_timeout
(Optional)0
to your plan's default timeout.criterion
(Optional)1
Consider execution succeeded when the HTTP code is 2xx.2
Consider execution succeeded when the HTTP code is 2xx and the HTTP body messge matches success_regexp.3
Consider execution failed when the HTTP code is 2xx and the HTTP body messge matches failure_regexp.success_regexp
(Optional)2
. When criterion is not 2
, this argument will be ignored. Maximum length is 255 chars.failure_regexp
(Optional)3
. When criterion is not 3
, this argument will be ignored. When the Maximum length is 255 chars.email_me
(Optional)0
: never send email notification.1
: send email if execution fails or returns to success from failure.sensitivity
(Optional)1
to 5
.group_id
(Optional)0
, the cron job will be made to belong to no group.http_method
(Optional)GET
.http_headers
(Optional)http_message_body
(Optional)send_slack
(Optional)0
: never send Slack notification.1
: send Slack notification if execution fails.2
: send Slack notification after each execution.slack_sensitivity
(optional)1
to 5
.slack_url
(Optional. If augument "send_slack" equals 1 or 2, "slack_url" is required.)wh
(Optional)0
: never send webhook notification.1
: send webhook if execution fails.2
: send webhook after each execution.wh_url
(Optional. If augument "wh" equals 1 or 2, "wh_url" is required.)wh_http_method
(Optional)GET
.wh_data[]
(Optional)status
(Optional)0
: disable the cron job.1
: enable the cron job.https://www.easycron.com/rest/edit?token=[token]&id=2107&cron_expression=* * * * * *&url=http%3A%2F%2Fwww.domain.com%2Fsendemails
In above example, [token] should be replaced with the true token string.
{"status":"success","cron_job_id":"2107"}
Above example response is equal to the following array:
Array ( [status] => success [cron_job_id] => 2107 )
If you use an invalid token, you may receive following error response:
{"status":"error","error":{"code":"1","message":"Wrong API token."}}
The equal readable array is:
Array ( [status] => error [error] => Array ( [code] => 1 [message] => Wrong API token. ) )
If there is something wrong with the arguments, you may receive other errors:
code: 2
message: Cron job name is too long.
code: 3
message: The cron expression you entered is invalid or it cannot be matched in a realitic future.
code: 9
message: The value of "email me" field is not valid.
code: 10
message: You need to upgrade your plan first to send email notifications.
code: 12
message: The execution interval cannot be lower than [mininmumMinuteInterval] minutes. You can upgrade your plan to a paid plan to remove this limit.
code: 13
message: The URL format is wrong.
code: 14
message: The domain is prohibited to be added by free user.
code: 23
message: You don't have enough EPDs to update the cron job.
code: 24
message: An error occurred when updating the cron job.
code: 25
message: The cron job ID is invalid.
If you make too much API requests in requests in one day, you may receive following error:
code: 26
message: You have exceeded your max daily API request limit.
code: 31
message: The value of "http_message_body" field is too long (longer than 1024).
code: 33
message: The URL is too long (longer than 1024).
code: 34
message: You need to upgrade your plan first to customize your HTTP method (to method other than "GET").
code: 35
message: You need to upgrade your plan first to customize your HTTP headers.
code: 36
message: The HTTP method you set is incorrect.
code: 37
message: The value of "HTTP headers" field is too long (longer than 10K).
code: 38
message: Invalid cron job group.
code: 39
message: Your plan has expired. Please renew your plan first.
code: 40
message: Your HTTP auth user is too long (longer than 100 chars).
code: 41
message: Your HTTP auth password is too long (longer than 100 chars).
code: 42
message: The value of "sensitivity" field is not valid.
code: 43
message: The value of "Cron job timeout" field is invalid.
code: 44
message: The value of "Cron job timeout" field cannot be longer than XXXX seconds (your plan's default timeout).
code: 45
message: The description is too long (longer than 1024).
code: 47
message: Invalid option for augument "wh".
code: 48
message: You need to upgrade to an Enterprise plan first to use "webhook" feature.
code: 49
message: You should add a webhook URL.
code: 50
message: Your webhook URL is invalid.
code: 51
message: Your webhook URL is too long (longer than 1024 chars).
code: 52
message: Invalid webhook HTTP method.
code: 53
message: Augument "wh_data" should be in array format (e.g. "wh_data[]").
code: 54
message: The domain is prohibited to be added.
code: 55
message: You need to upgrade your plan first to use the "output matching" feature.
code: 56
message: Success regular expression is too long (longger than 255 chars)
code: 57
message: Invalid success regular expression: ERROR_DESCRIPTION
code: 58
message: Failure regular expression is too long (longger than 255 chars)
code: 59
message: Invalid failure regular expression: ERROR_DESCRIPTION
code: 60
message: The timezone is invalid.
code: 61
message: Invalid option for augument "send_slack".
code: 62
message: You need to upgrade your plan first to send Slack notifications.
code: 63
message: You should add a Slack URL.
code: 64
message: Your Slack URL is invalid.
code: 65
message: Your Slack URL is too long (longer than 1024 chars).
code: 66
message: Invalid status.
code: 67
message: Invalid timezone_from.