http://api.cron.io/v1
Requests that require authentication use http basic auth
All data sent to and from this api is in Json
Create a user account.
The user's email address.
The username to be used when accessing cron.io
The password to be used when accessing cron.io
curl http://api.cron.io/v1/users -H "Content-Type: application/json" -X POST -d '{"email":"joan@example.com","username":"joan","password":"secret"}'
{
"message":"Account created. Please confirm your email address by clicking the link provided in an email we will send you shortly."
}
List all the crons you have stored in your account
curl -u username:password http://api.cron.io/v1/crons
[
{
"id": "4df99697314a97b68f000004",
"name": "my cron",
"url": "http://example.com",
"schedule": "* * * * *"
},
{
"id": "4df9fa7b2d4c06f59d000004",
"name": "my cron",
"url": "http://example.com",
"schedule": "30-40 * * * *"
}
]
When creating a new cron you must supply 3 properties; name, url and schedule. It can take up to 1 and a half minutes for your cron to become active.
The name of your cron
The url you wish to poll when this cron is run
The schedule for when you want this cron to run. For more details please see http://en.wikipedia.org/wiki/Cron for formating.
curl -u username:password http://api.cron.io/v1/crons -H "Content-Type: application/json" -X POST -d '{"name":"my cron","url":"http://example.com","schedule":"30-40 * * * *"}'
{
"id": "4df9fa7b2d4c06f59d000004",
"name": "my cron",
"url": "http://example.com",
"schedule": "30-40 * * * *"
}
Get a specific cron
curl -u username:password http://api.cron.io/v1/crons/4df9fa7b2d4c06f59d000004
{
"id": "4df9fa7b2d4c06f59d000004",
"name": "my cron",
"url": "http://example.com",
"schedule": "30-40 * * * *"
}
Update an existing cron.
curl -u username:password http://api.cron.io/v1/crons/4df9fa7b2d4c06f59d000004 -H "Content-Type: application/json" -X PUT -d '{"name":"My New Cron Name"}'
{
"id": "4df9fa7b2d4c06f59d000004",
"name": "My New Cron Name",
"url": "http://example.com",
"schedule": "30-40 * * * *"
}
curl -u username:password http://api.cron.io/v1/crons/4df9fa7b2d4c06f59d000004 -X DELETE