Get Many Cron Jobs
caution
Cron jobs are currently in ALPHA and are not considered stable. This feature may change at any time, please use with caution.
Retrieves the Cron jobs in your org
GET https://app.jiter.dev/api/cronjobsResponse
Code | Description |
---|---|
200 | Cron jobs returned successfully |
500 | Unable to retrieve cron jobs |
Example Usage
- TypeScript
index.ts
import axios from "axios";
const apiBaseUrl = "https://app.jiter.dev/api";
const getManyCronJobs = async () => {
try {
const { data } = await axios.get(`${apiBaseUrl}/cronJobs`, {
headers: { "x-api-key": "YOUR_API_KEY" },
});
console.log("Cron jobs found 🎉", data);
} catch (error) {
console.log("Unable to find cron jobs", error);
}
};
getManyCronJobs();
Example Success Response
[
{
"id": "3",
"createdAt": "2022-10-25T18:23:32.000Z",
"updatedAt": "2022-10-25T18:23:32.000Z",
"status": "Active",
"nextExecutionStatus": "Pending",
"expression": "* * * * *",
"nextExecutionDate": "2022-10-25T18:24:00.000Z",
"destination": "https://your-app.com/webhooks/jiter",
"org": "3",
"payload": "{'action':'buyGroceriesReminder','values':['eggs','bacon','pasta','bread']}"
},
{
"id": "4",
"createdAt": "2022-10-25T18:25:12.000Z",
"updatedAt": "2022-10-25T18:25:12.000Z",
"status": "Active",
"nextExecutionStatus": "Pending",
"expression": "* * * * *",
"nextExecutionDate": "2022-10-25T18:26:00.000Z",
"destination": "https://your-app.com/webhooks/jiter",
"org": "3",
"payload": "{'action':'buyGroceriesReminder','values':['eggs','bacon','pasta','bread']}"
},
{
"id": "5",
"createdAt": "2022-10-25T18:25:14.000Z",
"updatedAt": "2022-10-25T18:25:14.000Z",
"status": "Active",
"nextExecutionStatus": "Pending",
"expression": "* * * * *",
"nextExecutionDate": "2022-10-25T18:26:00.000Z",
"destination": "https://your-app.com/webhooks/jiter",
"org": "3",
"payload": "{'action':'buyGroceriesReminder','values':['eggs','bacon','pasta','bread']}"
}
]
Example Error Response
{
"message": "Unable to retrieve cron jobs"
}