Upload file to Bulk Insert job

Overview

This API uploads the input file for the bulk insert job specified by the job_id in the request URL. The file contains the records that will be processed.

Note:

  • The input file is deleted 3 days after upload.
  • The header of the csv file must be the link names of the fields to be inserted.
  • For Name and Address fields each subfield must be specified like Name.first_name, Name.last_name etc.

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

POST

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/stageRefers to the environment.

Scope

scope=ZohoCreator.bulk.CREATE

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 insert job

Response Structure

details JSON
  • object - Contains the details of the bulk upload job.

Note:

  • The file must be uploaded as either a zip file or a csv file.
  • The zip file must contain exactly one csv file. If the zip contains multiple files or a non-csv file, the upload will be rejected with an "Unsupported file" error.

  • To know more about the Bulk API limits, refer to this page.

Sample Request

Copiedcurl "https://www.zohoapis.com/creator/v2.1/bulk/jason18/zylker-store/form/Employee_Details/insert?job_id=3888833000000114027" \
  -X POST \
  -H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf" \
  -F "file=@/path/to/employees.csv"
CopiedfileObj = invokeUrl [
  url: "https://www.zohoapis.com/creator/v2.1/bulk/jason18/zylker-store/form/Employee_Details/insert/3888833000000114027",
  type: POST,
  files: myFileVariable,
  connection: "creatorconnection"
CopiedHttpUrl.Builder urlBuilder = HttpUrl.parse(
  "https://www.zohoapis.com/creator/v2.1/bulk/jason18/zylker-store/form/Employee_Details/insert"
).newBuilder()
  .addQueryParameter("job_id", "3888833000000114027");

File file = new File("/path/to/employees.csv");
RequestBody requestBody = new MultipartBody.Builder()
  .setType(MultipartBody.FORM)
  .addFormDataPart("file", file.getName(),
    RequestBody.create(file, MediaType.parse("text/csv")))
  .build();

Request request = new Request.Builder()
  .url(urlBuilder.toString())
  .method("POST", requestBody)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf")
  .build();

Response response = client.newCall(request).execute();
Copiedlet api_headers = {
  "Authorization": "Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
};

let formData = new FormData();
formData.append("file", fileInput.files[0]);

fetch("https://www.zohoapis.com/creator/v2.1/bulk/jason18/zylker-store/form/Employee_Details/insert?job_id=3888833000000114027", {
  method: "POST",
  headers: api_headers,
  body: formData
});
Copiedapi_headers = {
  "Authorization": "Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
}

files = {
  "file": ("employees.csv", open("/path/to/employees.csv", "rb"), "text/csv")
}

response = requests.post(
  "https://www.zohoapis.com/creator/v2.1/bulk/jason18/zylker-store/form/Employee_Details/insert",
  params={"job_id": "3888833000000114027"},
  headers=api_headers,
  files=files
)

Sample input (multipart/form-data)

Copied{
  "file": "target_file_path"
}

Sample Response

Copied {
    "code": 3000,
    "message": "File uploaded successfully"
 }