Loading...

Update a One-Time Cron

Description

This API enables you to update a one-time cron present in the project. The cron that needs to be updated will be referred using its unique identifier, such as name or ID.

Note:

Request Details

Request URL

PUT

{api-domain/}baas/v1/project/{project_id}/job_scheduling/cron/{cron_identifier (name/ID)}

copy

project_id
Numerical
The unique ID of the project

cron_id
Numerical
The unique ID of the cron

cron_name
String
The name of the cron

Request Headers

Authorization: Zoho-oauthtoken {oauth_token}
Content-Type: application/json

Optional Headers

CATALYST-ORG: {org_id}

Environment: Development

Scope

ZohoCatalyst.cron.UPDATE

Request JSON

You must send a JSON with its corresponding values as shown below.

Sample Payload
copy
{
"cron_name": "oneTimeCronFn",
"cron_type": "OneTime",
"cron_status": true,
"cron_execution_type": "pre-defined",
"job_meta": {
    "id": "10108000004280446",
    "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"
    },
    "params": {
    "param1": "value1"
    },
    "target_id": "10108000003823893"
},
"job_detail": {
    "time_of_execution": 1718002799,
    "timezone": "PST"
},
"id": "10108000004280444"
}
View more

You will feed this Request JSON to your Request Body, and you need to provide the value of:

cron_type String
mandatory
Will denote the schedule type of the cron
cron_status Boolean
mandatory
Will denote if the cron is enabled or disabled.
job_detail JSON
mandatory
Will contain the details on the job which is being submitted by the cron.
job_meta JSON
mandatory
Will contain the meta information about the job being submitted by the cron.
jobpool_id Numerical
mandatory
Will contain the Job Pool ID of the job pool that will execute the job.
job_name String
mandatory
Will contain the name of the job you are required to trigger.
target_type String
mandatory
Will denote which target type’s endpoint is going to be triggered. Can be Function, Webhook, Circuit, or AppSail.
target_id Numerical
mandatory
Will contain the unique ID with which the target type will be referred.
params JSON
mandatory
Will contain the value of the headers and params you pass while submitting the job.
cron_name String
mandatory
Will contain the name of the cron you are going to create.
cron_execution_type String
mandatory
Will denote if it is a pre-defined cron or dynamic cron.

Response Details

The JSON response returns the metadata of the updated cron. The response will also contain the details of the user who updated the cron.

Sample Request
copy

curl -X PUT \ https://api.catalyst.zoho.com/baas/v1/project/10108000003823392/job_scheduling/cron/10108000004280444 -H “Authorization: Zoho-oauthtoken 1000.91016.2f57” -H “Content-Type:application/json” --data-raw ‘{“cron_name”:“oneTimeCronFn”,“cron_type”:“OneTime”,“cron_status”:true,“cron_execution_type”:“pre-defined”,“job_meta”:{“id”:“10108000004280446”,“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”},“params”:{“param1”:“value1”},“target_id”:“10108000003823893”},“job_detail”:{“time_of_execution”:1718002799,“timezone”:“PST”},“id”:“10108000004280444”}’

View more
Sample Response
copy
{
"status": "success",
"data": {
    "cron_name": "oneTimeCronFn",
    "cron_type": "OneTime",
    "cron_execution_type": "pre-defined",
    "job_meta": {
    "id": "10108000004280726",
    "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,
    "modified_time": "Jun 07, 2024 12:53 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": 1718002799,
    "hour": 0,
    "minute": 0,
    "second": 0,
    "timezone": "PST"
    },
    "id": "10108000004280444"
}
}
View more