View the latest 10 execution logs of a cron job.
token
(Required)id
(Required)https://www.easycron.com/rest/logs?token=[token]&id=2107
In above example, [token] should be replaced with the true token string.
{"status":"success","logs":[{"cron_job_id":"3801","scheduled_time":"2012-08-12 23:28:00 HKT","fire_time":"2012-08-12 23:28:03 HKT","done_time":"2012-08-12 23:28:03 HKT","execute_time":"0.508","http_code":200,"error":"",total_time":"0.509","log_id":"5a73273ed6f8c903e357def4"}]}
Above example response is equal to the following array:
Array ( [status] => success [logs] => Array ( [0] => Array ( [cron_job_id] => 3801 [scheduled_time] => 2012-08-12 23:28:00 HKT [fire_time] => 2012-08-12 23:28:03 HKT [done_time] => 2012-08-12 23:28:03 HKT [execute_time] => 0.508 [http_code] => 200 [error] => [total_time] => 0.509 [log_id] => 5a73273ed6f8c903e357def4 ) ) )
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 error:
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.