Create a HTTP Cron Request
Pass a JSON object to https://api.devtabs.io/v1/createCronRequest with the following fields
apiKey : String (Required)
Get the api key from the project dashboard. You can generate multiple api keys per project.
name: String (Required)
Name of the cron job. You can later use this to search on the cron dashboard.
description: String (Optional)
Optional description of the cron job. Can view the job info along with the decsiption in the dashboard.
identifiers: Dictionary (Optional)
json object where the values must be strings.
Example:
This a way to tag each job and you can search by the value in the dashboard.
One way to keep track of all jobs belonging to a particular user for example.
httpMethod: String (Required)
Must be GET, PUT, POST, DELETE, HEAD, or PATCH
url: String (Required)
a valid url. This can be the url to your api/backend service that needs to be called.
recurring: Boolean (Required)
Specify whether the cron job is recurring or not. Pass in true or false.
recurringCronExpression: String (Optional/Required)
if recurring is true then you must supply a recurringCronExpression. This can be any valid cron expression. You cannot pass the empty string ""
timezone: String (Optional/Required)
if recurring is true you must pass a timezone.
here are a list of valid timezones:
timeToFire: Date (Optional/Required)
if recurring is false then you must supply a timeToFire. This is the time the cron job will execute and call your specified url. The date object must be in UTC.
headers: Dictionary (Optional)
Any valid json object that you want to send in the headers field.
payload: Dictionary (Optional)
Any valid json object that you want to send in the data field.
successCriteria: Dictionary (Optional)
if you leave this field blank the cron job will be considered a success if the response status code starts with a 2xx and considered failed otherwise.
If you want to determine either success of failure based on a regex you can pass in one of the following
The below object indicates that if the response from the cron execution matches the regex it will be considered a success and otherwise will be considered as failed.
The below object indicates that if the response from the cron execution matches the regex it will be considered as failed and otherwise will be considered as succeeded.
notifications: Dictionary (Optional)
Pass a dictionary containing the following attributes
Specify if you want to be notified on failure or success. Pass in usernames and group ids to be notified. And the mechanism you want to be notified via.
configurations: Dictionary (Optional)
Specify the number of retries and timeout
retries has to be 1, 3 or 5.
Last updated