Skip to content

Get a Cron Job

Get a cron job of current user by cron job ID.

Method

GET

Endpoint

https://api.easycron.com/v1/cron-jobs/{cron_job_id}
Some other possible URLs:
https://api.easycron.com/v1/cron-jobs/{cron_job_id}?pretty

NOTE:  By appending pretty in the request URL query string, you can get a pretty printed JSON (indented with spaces).

Example API call

Terminal window
curl \
--include \
--request GET \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <API_KEY>' \
"https://api.easycron.com/v1/cron-jobs/{cron_job_id}"

Example Success Response

Together with the HTTP code 200, the following content will be responded:

{
"cron_job_id": 2133739,
"url": "https://www.example.com/xxx",
"http_auth_user": "",
"http_auth_pw": "",
"cron_expression": "* * * * * *",
"timezone": "Asia/Hong_Kong",
"http_method": "GET",
"http_headers": "",
"http_message_body": "",
"timeout": 0,
"success_criterion": 1,
"success_regexp": "",
"failure_regexp": "",
"send_email": 1,
"email_threshold": 2,
"send_slack": 2,
"slack_threshold": 1,
"slack_url": "https://hooks.slack.com/services/xxx/yyy/zzz",
"send_webhook": 2,
"webhook_http_method": "POST",
"webhook_url": "https://example.com/webhook",
"webhook_data": [
"CRON_JOB_ID",
"CRON_JOB_NAME",
"CRON_JOB_URL",
"CRON_JOB_HTTP_STATUS_CODE",
"CRON_JOB_EXECUTION_STATUS",
"CRON_JOB_EXECUTION_ERROR"
],
"status": 0,
"epds_occupied": 1440,
"cron_job_name": "notifications",
"description": "",
"group_id": 25138,
"total_successes": 234,
"total_failures": 0,
"current_failures": 0
}

Example Failure Response

Together with the HTTP code of the error, the following error message will be responded:

{"message":"ERROR_MESSAGE"}