Start/Abort Bulk Insert job

Overview

This API help to update the status to start or abort for a specific bulk insert job specified by the job_id in the request URL. The action specified in the request body will be performed on that job. Supported actions include starting or aborting the bulk job. 

Request Details

Request URL

https://<base_url>/creator/v2.1/bulk/<account_owner_name>/<app_link_name>/form/<form_link_name>/insert/<job_id>

Request method

PATCH

Header

KeyValueDescription
Authorization

Zoho-oauthtoken10

00.8cb99dxxxxx

xxxxxxxx9be93.9b

8xxxxxxxxxxxxxxxf

An authentication token (oauthtoken) allows users to access apps and APIs without entering their login credentials each time.
environmentdevelopment/stageSpecifies the environment.

Scope

scope=ZohoCreator.bulk.UPDATE

where,

base_urlthe base URL of your Creator account
For example, it's www.zohoapis.com if your account belongs to Zoho's US DC, and is www.zohoapis.eu if it belongs to Zoho's EU DC.
account_owner_namethe username of the Creator account's owner
app_link_namethe link name of the target application
form_link_namethe link name of the target form
job_idunique identifier of the bulk job

Request JSON

data JSON

  • object - Contains the action to be performed on the bulk job.
  • action (string) - Specifies the action to perform on the job.
    • Start - Starts processing the uploaded file.
    • Abort - Stops the job and prevents further processing.

Response Structure

details JSON

  • object - Contains the response details of the bulk job status update.
  • code (integer) - Indicates whether the API request was successful or failed.
Note: To know more about the Bulk API limits, refer this page.

Sample Request

Copied#Start
curl "https://creator.zoho.com/api/v2.1/{account_owner_name}/{app_link_name}/report/{report_link_name}/bulk/job/{job_id}" \
-X POST \
-H "Authorization: Zoho-oauthtoken 1000.xxxxxxx.xxxxxxx" \
-H "Content-Type: application/json" \
-d '{
    "data": {
        "action": "start"
    }
}
```

#Abort
```bash
curl "https://www.zohoapis.com/creator/v2.1/bulk/jason18/zylker-store/form/Employee_Details/insert/3888833000000114027" \
  -X PUT \
  -H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
        "action": "abort"
    }'
Copied//Start action
url = "https://creator.zoho.com/api/v2.1/{account_owner_name}/{app_link_name}/report/{report_link_name}/bulk/job/{job_id}";

bodyMap = Map();
dataMap = Map();

dataMap.put("action", "start");
bodyMap.put("data", dataMap);

response = invokeurl
[
    url : url
    type : POST
    headers : {
        "Authorization":"Zoho-oauthtoken 1000.xxxxxxx.xxxxxxx"
    }
    body : bodyMap.toString()
    content-type : "application/json"
];

info response;
Copiedimport java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        try {
            URL url = new URL(
                "https://creator.zoho.com/api/v2.1/{account_owner_name}/{app_link_name}/report/{report_link_name}/bulk/job/{job_id}"
            );

            HttpURLConnection conn = (HttpURLConnection) url.openConnection();

            conn.setRequestMethod("POST");
            conn.setRequestProperty("Authorization", "Zoho-oauthtoken 1000.xxxxxxx.xxxxxxx");
            conn.setRequestProperty("Content-Type", "application/json");
            conn.setDoOutput(true);

            String jsonInputString = "{\n" +
                    "  \"data\": {\n" +
                    "    \"action\": \"start\"\n" +
                    "  }\n" +
                    "}";

            try(OutputStream os = conn.getOutputStream()) {
                byte[] input = jsonInputString.getBytes("utf-8");
                os.write(input, 0, input.length);
            }

            System.out.println("Response Code: " + conn.getResponseCode());

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Copiedconst url = "https://creator.zoho.com/api/v2.1/{account_owner_name}/{app_link_name}/report/{report_link_name}/bulk/job/{job_id}";

const payload = {
    data: {
        action: "start"
    }
};

fetch(url, {
    method: "POST",
    headers: {
        "Authorization": "Zoho-oauthtoken 1000.xxxxxxx.xxxxxxx",
        "Content-Type": "application/json"
    },
    body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => {
    console.log(data);
})
.catch(error => {
    console.error("Error:", error);
});
Copiedimport requests

url = "https://creator.zoho.com/api/v2.1/{account_owner_name}/{app_link_name}/report/{report_link_name}/bulk/job/{job_id}"

headers = {
    "Authorization": "Zoho-oauthtoken 1000.xxxxxxx.xxxxxxx",
    "Content-Type": "application/json"
}

payload = {
    "data": {
        "action": "start"
    }
}

response = requests.post(url, json=payload, headers=headers)

print(response.status_code)
print(response.text)

Sample input to start or abort a job

Copied{
     "data": {
     "action": "start/abort"
   }
}

Sample Response

Copied//Start
{
    "code": 3000,
    "status": "Job created successfully"
}

//Aborted
 {
    "code": 3000,
    "status": "Job aborted successfully"
}