Cron Job API Method: log

Description

View the truncated output of a specific log ID.

Arguments

token (Required)
You API token. Check authentication section for details.
id (Required)
ID of the cron job you want to get logs.
log_id (Required)
ID of the log. You may get this from the responded field "log_id" in the logs API.

Example Request

https://www.workcron.com/rest/logs?token=[token]&id=2107&log_id=5a732996d6f8c907fc113ff1

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

Example Success Response (in JSON format)

{"status":"success","truncated_output":"cron job successfully done."}

Above example response is equal to the following array:

Array
(
    [status] => success
    [truncated_output] => cron job successfully done.
)

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 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.

code: 27

message: The log ID is invalid.