API Docs

Introduction

With an API Token, you can work with your cronjobs, groups and account settings programmatically without logging in. We provide a REST API which you can just send your request data along with your API token.

API token is a 32 character string which is uniquely generated for all SetCronJob users. You can visit Account > API Key to copy your API key, and regenerate API token just in case.

Authentication

All API request must be sent via HTTP to a URL with format

https://www.setcronjob.com/api/[target].[action]

Please note that SetCronJob API server responds only via https (secured).

Support targets are cron, group, account and server. Target's actions can be found under each target's section.

For example, to get the server's time, send your HTTP request to

https://www.setcronjob.com/api/server.time

Each API request requires a token variables which can be sent via either POST, GET or URL params as described in Request formats section below.

Request formats

You can pass parameters via either POST or GET parameters.

POST recommended

All data including token must be sent to

https://www.setcronjob.com/api/[target].[action]

The POST body should be either query string or JSON format:

token=******&id=1&name=weekly
{"token":"******","id":1,"name":"weekly"}

GET variables

https://www.setcronjob.com/api/[target].[action]?token=[token]&name=value

Example requests:

https://www.setcronjob.com/api/server.time?token=******
https://www.setcronjob.com/api/cron.edit?token=******&id=1&name=weekly

Response format

The response is in JSON format, includes these members

status
Either success or error.
code
The error code, 0 means ok/success.
data
Result data, available in success result only
info
An array/collection of info messages (rarely used), available in success result only
message
The error message, available in error result only

Sample API Request

https://www.setcronjob.com/api/server.time?token=******

Success response

{"data":1378382828,"info":[],"status":"success","code":0}

Error response

{"message":"Invalid API token, user not found.","status":"error","code":11}