Loading...

Submit Cron Instantly

Description

This API enables you to submit a cron that will instantly submit a job to the job pool to trigger a target type endpoint.

Note:

  • This API is ideally used to test if the configured cron is functioning as configured.

  • 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

POST

{app_domain}/baas/v1/project/{project_id}/job_scheduling/cron/{cron_id}/submit_job

copy

project_id
Numerical
The unique ID of the project

cron_id
Numerical
The unique ID of the cron

Request Headers

Authorization: Zoho-oauthtoken {oauth_token}

Optional Headers

CATALYST-ORG: {org_id}

Environment: Development

Scope

ZohoCatalyst.cron.CREATE

Response Details

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

Note: The above response is for a cron submitting a function job. For webhook, AppSail, and Circuit, the target_type will change. This is quite similar to the API functionality illustrated in Submit a Job.
Sample Request
copy
Sample Response
copy
{
"status": "success",
"data": {
    "job_id": "10108000004251242",
    "created_time": "Jun 07, 2024 10:32 AM",
    "response_code": null,
    "start_time": {},
    "end_time": {},
    "submitted_on": {
    "startTimeToRedirectLogsPage": "07/06/2024 10:27",
    "timeWithGivenTimezone": "Jun 07, 2024 10:32 AM IST",
    "timeWithJobTimezone": "Jun 07, 2024 10:32 AM IST"
    },
    "job_status": "PENDING",
    "capacity": {
    "memory": "256"
    },
    "job_meta_details": {
    "id": "10108000003822191",
    "url": "",
    "job_name": "delayJob",
    "job_config": {
        "number_of_retries": 0
    },
    "target_type": "Function",
    "target_details": {
        "id": "10108000003822071",
        "target_name": "fn"
    },
    "source_type": "Cron",
    "source_details": {
        "id": "10108000003822189",
        "source_name": "check2",
        "details": {
        "cron_execution_type": "pre-defined"
        }
    },
    "jobpool_id": "10108000003822066",
    "headers": {},
    "params": {}
    },
    "retried_count": null,
    "parent_job_id": "10108000004251242",
    "execution_time": null,
    "cron_circuit_id": null,
    "circuit_execution": null,
    "status": false
}
}
View more