This API is deprecated and will stop processing data in the future. Please use our new EasyCron API v1 instead.

Cron Job API Method: detail

Description

Get detail of a cron job.

Arguments

token (Required)
You API token. Check authentication section for details.
id (Required)
ID of the cron job you want to get detail of.

Example Request

https://www.easycron.com/rest/detail?token=[token]&id=2107

In above example, [token] should be replaced with the true token string.

Example Success Response (in JSON format)

{"status":"success","cron_job":{"cron_job_id":"2107","cron_job_name":"Read feeds","description":"Triggers script to read feeds.","user_id":"1","url":"http:\/\/www.domain.com\/readfeeds","auth_user":"user123","auth_pw":"pw123","cron_expression":"15 1 * * * *","timezone":"UTC","total_successes":"0","total_failures":"0","number_failed_time":"0","epds_occupied":"2","email_me":"1","sensitivity":"1","send_slack":"1","slack_sensitivity":"1","slack_url":"https://hooks.slack.com/services/xxx","group_id":"74","http_method":"GET","http_headers":"","http_message_body":"","custom_timeout":"30","criterion":"2","success_regexp":"succeeded","failure_regexp":"","wh":"1","wh_url":"http://example.com/hook.php","wh_http_method":"POST","wh_data":["CRON_JOB_ID","CRON_JOB_NAME"],"status":"0","created":"2012-03-19 17:04:18","updated":"2012-08-11 14:25:23"}}

Above example response is equal to the following array:

Array
(
    [status] => success
    [cron_job] => Array
        (
            [cron_job_id] => 2107
            [cron_job_name] => Read feeds
            [description] => Triggers script to read feeds.
            [user_id] => 1
            [url] => http://www.domain.com/readfeeds
            [auth_user] => user123
            [auth_pw] => pw123
            [cron_expression] => 15 1 * * * *
            [timezone] => UTC
            [total_successes] => 0
            [total_failures] => 0
            [number_failed_time] => 0
            [epds_occupied] => 2
            [email_me] => 1
            [sensitivity] => 1
            [send_slack] => 1
            [slack_sensitivity] => 1
            [slack_url] => https://hooks.slack.com/services/xxx
            [group_id] => 74
            [http_method] => GET
            [http_headers] =>
            [http_message_body] =>
            [custom_timeout] => 30
            [criterion] => 2
            [success_regexp] => succeeded
            [failure_regexp] =>
            [wh] => 1
            [wh_url] => http://example.com/hook.php
            [wh_http_method] => POST
            [wh_data] => Array(CRON_JOB_ID, CRON_JOB_NAME)
            [status] => 0
            [created] => 2012-03-19 17:04:18
            [updated] => 2012-08-11 14:25:23
        )
)

The attributes of the above result are pretty self-explanatory except for two of them. The first one is "email_me". Its value could be 0 (never send email), 1 (send email if the cron job failed) and 2 (send email after each execution of the cron job). The other one is "status". Its value could be 0 (disabled), 1 (enabled) and 2 (failed).

Example Error Response (in JSON format)

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: 25

message: The cron job ID is invalid.

If you make too much API requests in one day, you may receive following error:

code: 26

message: You have exceeded your max daily API request limit.