Create a One-Time Cron
Description
This API enables you to create a one-time cron that submits a Job to the Job Pool to trigger a Job Function endpoint.
Note:
-
In this API, we are illustrating the sample request and sample response with a Job Function. The API functionality remains the same for webhook, Circuits, and AppSail jobs.
-
This API is applicable for Pre-Defined Crons and Dynamic Crons.
Request Details
Request URL
{api-domain/}baas/v1/project/{project_id}/job_scheduling/cron
Request Headers
Authorization: Zoho-oauthtoken {oauth_token}
Content-Type: application/json
Optional Headers
CATALYST-ORG: {org_id}
Environment: Development
Scope
ZohoCatalyst.cron.CREATE
Request JSON
You must send a JSON with its corresponding values as shown below.
{
"cron_type": "OneTime",
"cron_status": true,
"job_detail": {
"time_of_execution": 1717916399,
"timezone": "PST"
},
"job_meta": {
"source_type": "Cron",
"job_config": {
"number_of_retries": "1",
"retry_interval": "60"
},
"job_name": "jobName",
"jobpool_id": "10108000003823563",
"target_type": "Function",
"target_id": "10108000003823893",
"params": {
"param1": "value1"
}
},
"cron_name": "oneTimeCronFn",
"cron_execution_type": "pre-defined"
}
You will feed this Request JSON to your Request Body, and you need to provide the value of:
Response Details
The JSON response returns the metadata of the created cron. The response will also contain the details of the user who created the cron.
curl -X POST \ ‘https://api.catalyst.zoho.com/baas/v1/project/10108000003823392/job_scheduling/cron
-H “Authorization: Zoho-oauthtoken 1000.91016.2f57”
-H “Content-Type:application/json”
--data-raw ‘{“cron_type”:“OneTime”,“cron_status”:true,“job_detail”:{“time_of_execution”:1717916399,“timezone”:“PST”},“job_meta”:{“source_type”:“Cron”,“job_config”:{“number_of_retries”:“1”,“retry_interval”:“60”},“job_name”:“jobName”,“jobpool_id”:“10108000003823563”,“target_type”:“Function”,“target_id”:“10108000003823893” ,“params”:{“param1”:“value1”}},“cron_name”:“oneTimeCronFn”,“cron_execution_type”:“pre-defined”}’
{
"status": "success",
"data": {
"cron_name": "oneTimeCronFn",
"cron_type": "OneTime",
"cron_execution_type": "pre-defined",
"job_meta": {
"id": "10108000004280446",
"url": "",
"job_name": "jobName",
"job_config": {
"number_of_retries": 1,
"retry_interval": 60
},
"target_type": "Function",
"target_details": {
"id": "10108000003823893",
"target_name": "target_function_fetch"
},
"source_type": "Cron",
"source_details": {
"id": "10108000004280444",
"source_name": "oneTimeCronFn",
"details": {
"cron_execution_type": "pre-defined"
}
},
"jobpool_id": "10108000003823563",
"jobpool_details": {
"type": "Function",
"name": "VendorReminder",
"created_by": {
"zuid": "77941453",
"is_confirmed": false,
"email_id": "emmy@zylker.com",
"first_name": "Amelia Burrows",
"last_name": "",
"user_type": "Admin",
"user_id": "10108000000009004"
},
"created_time": "May 28, 2024 04:44 PM",
"modified_by": {
"zuid": "77941453",
"is_confirmed": false,
"email_id": "emmy@zylker.com",
"first_name": "Amelia Burrows",
"last_name": "",
"user_type": "Admin",
"user_id": "10108000000009004"
},
"modified_time": "May 28, 2024 04:44 PM",
"capacity": {
"memory": "2048"
},
"project_details": {
"project_name": "ZylkerShipments",
"id": "10108000003823392",
"project_type": "Live"
},
"id": "10108000003823563"
},
"headers": {},
"params": {
"param1": "value1"
}
},
"cron_status": true,
"created_time": "Jun 07, 2024 12:26 PM",
"created_by": {
"zuid": "77941453",
"is_confirmed": false,
"email_id": "emmy@zylker.com",
"first_name": "Amelia Burrows",
"last_name": "",
"user_type": "Admin",
"user_id": "10108000000009004"
},
"modified_time": "Jun 07, 2024 12:26 PM",
"modified_by": {
"zuid": "77941453",
"is_confirmed": false,
"email_id": "emmy@zylker.com",
"first_name": "Amelia Burrows",
"last_name": "",
"user_type": "Admin",
"user_id": "10108000000009004"
},
"project_details": {
"project_name": "ZylkerShipments",
"id": "10108000003823392",
"project_type": "Live"
},
"end_time": "-1",
"cron_detail": {
"jobId": "10108000004280444",
"transactionTimeout": -1,
"time_of_execution": 1717916399,
"hour": 0,
"minute": 0,
"second": 0,
"timezone": "PST"
},
"id": "10108000004280444"
}
}
Yes
No
Send your feedback to us