Get Cron Jobs
Get the cron jobs of current user.
Method
GET
Endpoint
https://api.easycron.com/v1/cron-jobs
Some other possible URLs:
https://api.easycron.com/v1/cron-jobshttps://api.easycron.com/v1/cron-jobs?page=33&cron_job_group_id=39533&order=aschttps://api.easycron.com/v1/cron-jobs?page=33&cron_job_group_id=39533&order=asc&prettyhttps://api.easycron.com/v1/cron-jobs?sort_by=total_successes&order=desc"
NOTE: By appending
pretty
in the request URL query string, you can get a pretty printed JSON (indented with spaces).
Query parameters
name | type | required | default | description | limits |
---|---|---|---|---|---|
cron_job_group_id | int | optional | The ID of the cron job group that the returned results should belong to. | ||
page | int | optional | 1 | Page number. | |
page_size | int | optional | 10 | The result number in one page. | min=1, max=500 |
sort_by | string | optional | cron_job_id | What to sort results by. Allowed values: cron_job_id , cron_job_name , url , epds_occupied , total_successes , total_failures , current_failures | |
order | string | optional | desc | The order the returned results should be in. Allowed values: desc , asc |
Example API call
curl \--include \--request GET \--header 'Content-Type: application/json' \--header 'X-API-Key: <API_KEY>' \"https://api.easycron.com/v1/cron-jobs?pretty"
Example Success Response
Together with the HTTP code 200
, the following content will be responded:
{ "cron_jobs": [ { "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 }, { "cron_job_id": 3988278, "url": "https://www.example.com", "http_auth_user": "", "http_auth_pw": "", "cron_expression": "23 13 22 5 * *", "timezone": "Asia/Hong_Kong", "http_method": "GET", "http_headers": "", "http_message_body": "", "timeout": 0, "success_criterion": 1, "success_regexp": "", "failure_regexp": "", "send_email": 0, "email_threshold": 1, "send_slack": 0, "slack_threshold": 1, "slack_url": "", "send_webhook": 0, "webhook_http_method": "GET", "webhook_url": "", "webhook_data": [], "status": 1, "epds_occupied": 1, "cron_job_name": "", "description": "", "group_id": 0, "total_successes": 13, "total_failures": 0, "current_failures": 0 }, ... ], "meta": { "page": 1, "page_size": 10, "result_count": 10, "total_count": 58 }}
Example Failure Response
Together with the HTTP code of the error, the following error message will be responded:
{"message":"ERROR_MESSAGE"}