Loading...

Submit a Circuit Job By ID

Description

This API enables you to submit a job to a Job Pool that triggers a Circuit’s endpoint.

Request Details

Request URL

POST

{api-domain}/baas/v1/project/{project_id}/job_scheduling/job

copy

project_id
Numerical
The unique ID of the project

Request Headers

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

Optional Headers

CATALYST-ORG: {org_id}

Environment: Development

Scope

ZohoCatalyst.job.CREATE

Request JSON

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

Sample Payload
copy
{
"source_type": "API",
"job_config": {
    "number_of_retries": "4",
    "retry_interval": 300
},
"job_name": "circuitJob",
"jobpool_id": "10108000003823699",
"target_type": "Circuit",
"target_id": "10108000004194246",
"test_cases": {
    "key1": "value1",
    "key2": "value2",
    "key3": "value3"
}
}
View more

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

request_method
mandatory
This denotes the request method the webhook will be triggered with, and the values can be get, post, put, delete, head, or patch.
source_type
mandatory
Will always contain API as its value for submit job API.
job_config JSON
mandatory
Will contain the key value pairs number_of_retries, and retry_interval. This will determine the retry action in the event of a failure.
target_type String
mandatory
Will denote which target type the job is meant to trigger.
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_id Number
mandatory
Will contain the unique ID of the Circuit the job is meant to trigger.
test_cases JSON
optional
Will contain the JSON key value pair input you need to feed to the Circuit.

Response Details

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

Sample Request
copy

curl -X POST
https://api.catalyst.zoho.com/baas/v1/project/{project_id}/job_scheduling/job -H “Authorization: Zoho-oauthtoken 1000.91016.2f57” -H “Content-Type:application/json” --data-raw ‘{“source_type”:“API”,“job_config”:{“number_of_retries”:“4”,“retry_interval”:300},“job_name”:“circuitJob”,“jobpool_id”:“10108000003823699”,“target_type”:“Circuit”,“target_id”:“10108000004194246”,“test_cases”:{“key1”:“value1”,“key2”:“value2”,“key3”:“value3”}}’

Sample Response
copy
{
"status": "success",
"data": {
    "job_id": "10108000004194251",
    "created_time": "Jun 05, 2024 04:56 PM",
    "response_code": null,
    "start_time": {},
    "end_time": {},
    "submitted_on": {
    "startTimeToRedirectLogsPage": "05/06/2024 16:51",
    "timeWithGivenTimezone": "Jun 05, 2024 04:56 PM IST",
    "timeWithJobTimezone": "Jun 05, 2024 04:56 PM IST"
    },
    "job_status": "PENDING",
    "capacity": {
    "number": "1"
    },
    "job_meta_details": {
    "id": "10108000004194252",
    "job_name": "circuitJob",
    "job_config": {
        "number_of_retries": 4,
        "retry_interval": 300
    },
    "target_type": "Circuit",
    "target_details": {
        "id": "10108000004194246",
        "target_name": "abc"
    },
    "source_type": "API",
    "source_details": {
        "source_name": "API"
    },
    "jobpool_id": "10108000003823699",
    "jobpool_details": {
        "type": "Circuit",
        "name": "InventoryDataMaintaince",
        "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:49 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:49 PM",
        "project_details": {
        "project_name": "ZylkerShipments",
        "id": "10108000003823392",
        "project_type": "Live"
        },
        "id": "10108000003823699"
    },
    "headers": {},
    "params": {
        "key1": "value1",
        "key2": "value2",
        "key3": "value3"
    }
    },
    "retried_count": null,
    "parent_job_id": "10108000004194251",
    "execution_time": null
}
}
View more