Create Bulk Write Job

Purpose

To create a bulk write job.

Request URL

https://recruit.zoho.com/recruit/bulk/v2/write

Request Method

POST

Scope

scope=ZohoRecruit.bulk.CREATE
(or)

ZohoRecruit.bulk.ALL
(and)
scope=
ZohoRecruit.modules.ALL
(or)
Scope=
ZohoRecruit.modules.{module_name}.{operation_type}

 

Possible module namesPossible operation types
candidate, jobopening, client, interview, contact, department, custommoduleALL - Full access to the record
CREATE - Create a bulk write job

Request JSON

AttributeData TypeMandatoryDescription
character_encodingStringNoRepresents the charset of the uploaded file. It is usually auto-detected. But if specified, then it will be used to read the file.
operationStringYesRepresents the type of operation you want to perform on the bulk write job.
Values are
  • insert - To create CSV records as new records in Zoho Recruit
  • update - To update an existing record in Zoho Recruit(This operation does not allow creation of new records).
  • upsert - To update an existing record in Zoho Recruit and create new records, if it does not exist already
callback Show propertiesJSON ObjectNoA valid URL that should allow the HTTP POST method. The Bulk Write Job's details are posted to this URL upon successful completion of the job or upon the failure of the job. Sample - "callback" : { "url": "https://sampledomain.com/getzohoresponse", "method": "post" }

callback Properties

AttributesData TypeMandatoryDescription
urlString(URL)YesA valid URL, which should allow HTTP POST method. The Bulk Write Job's details are posted to this URL on successful completion of job or on failure of job.
methodStringYesSpecifies the HTTP method of the callback url. Only HTTP POST method is supported. The allowed value is post.
resourceShow propertiesJSON ArrayNoA JSON array of objects containing the API names of modules that you want to import, their field mappings, and the corresponding file IDs obtained from Upload API.

resource Properties

AttributesData TypeMandatoryDescription
typeStringYesRepresents the type of module that you want to import. The value is data.
moduleStringYesAPI name of the module that you select for bulk write job.
file_idStringYesRepresents the file_id obtained from file upload API.
ignore_emptyBooleanNoTrue - Ignores the empty values in a column and updates only the fields of a record without empty values
False or empty - The system updates records in Zoho Recruit with empty values in the given file column.
The default value is false.
find_byStringYes(for update and upsert)
No(for insert)
Specify the API name of a unique field or ID of a record. The system uses the value of this field to find the existing records in Zoho Recruit. When you specify this parameter for insert operation, the system will skip the existing records from the file.
field_mappings
Show properties
JSON ArrayNoWhen the system processes a CSV file, the first row is treated as the header row. Each header name is treated as a field API name and data from a column is populated into the corresponding field represented by the API name. This parameter helps you to skip the auto-mapping and define your own field mapping.

field_mappings Properties

AttributesData TypeMandatoryDescription
api_nameStringYesAPI name of the field present in the Zoho module object that you want to import. Refer Fields Meta Data API for the list of fields available in a module. An invalid field API name throws an error.
indexNumberNoThe column index of the field you want to map to the Zoho Recruit field. When you specify a non-existing index value, the system throws an error.
default_valueJSON ObjectNoUse this key if some of the records do not have a value in a column, and you want to replace it with a default value. Example: {"value": "Trade Show"}

Response Structure

AttributeData TypeDescription
statusStringSpecifies the status of the API call. Sample - "status": "success".
messageStringSpecifies the pre-defined comments for the job. Useful in case any errors occur.
details Show propertiesJSON ObjectPlease refer the below table for information on the "details" JSON object.

details Properties

AttributesData TypeDescription
idStringSpecifies the unique identifier of the bulk write job. Sample - "id": "1000010760002".
created_byJSON ObjectSpecifies the ID and Name of the user who initiated the bulk write job. Sample - "created_by": { "id": "1000000031045", "name": "Patricia Boyle" },

Possible Errors

HTTP StatusError CodeMessageReason
400MANDATORY_FIELDS_NOT_MAPPEDAll mandatory fields are not mappedAll mandatory fields in the module are not mapped
400MANDATORY_NOT_FOUNDMandatory key is not availableMandatory key or value is not specified in the request body.
Example: "message": "Required key find_by is not available".
400INVALID_FIELDinvalid mapping. invalid api_name {{api_name}}The field API name is invalid
400INVALID_FORMATinvalid mapping. invalid format Invalid format for sysref - {field_api_name}Date is entered in the wrong format
400INVALID_FILE_IDinvalid file_id {{file_id}}The file ID specified is invalid
400HEADER_LIMIT_EXCEEDEDImport file does not exceed 200 columnsThe number of fields mapped has exceeded the maximum limit of 200
400COLUMN_INDEX_NOT_FOUNDInvalid column index mapped. Index is invalid for sysref {field_api_name}.Index is mapped with negative values
400MODULE_NOT_AVAILABLERequested module {module_api_name} is not availableThe module name specified is invalid

Sample Request

Copiedcurl "https://recruit.zoho.com/recruit/bulk/v2/write"
-X POST
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@inputData.json"

In the request, @inputData.json contains the sample input data.

Sample Input for Bulk Insert

Copied{
 "operation": "insert",
 "resource": [
   {
     "type": "data",
     "module": "Candidates",
     "file_id": "17774000000857001",
     "field_mappings": [
       {
         "api_name": "First_Name",
         "index": 1
       },
       {
         "api_name": "Last_Name",
         "index": 2
       },
       {
         "api_name": "Email",
         "index": 4
       },
       {
           "api_name": "Current_Company",
           "index": 27
       },
       {
           "api_name": "Candidate_Status",
           "index": 33
       }
     ]
   }
 ]
}

Sample Input for Bulk Update

Copied{
  "operation": "update",
  "resource": [
    {
      "type": "data",
      "module": "Contacts",
      "file_id": "111111000000541958",
      "field_mappings": [
        {
          "api_name": "Last_Name",
          "index": 0
        },
        {
          "api_name": "Id",
          "index": 1
        }
      ],
      "find_by": "Id"
    }
  ],
  "callBack": {
    "url": "http://requestbin.fullcontact.com/1bvgfh61",
    "method": "post"
  }
}

Sample Response

Copied{
  "status": "success",
  "code": "SUCCESS",
  "message": "success",
  "details": {
    "id": "111111000000541958",
    "created_by": {
      "id": "111111000000035795",
      "name": "Patricia Boyle "
    }
  }
}