Zoho Recruit | uploadFile Method



You can use this method to attach files to records.

Request URL

For OAuth Authentication

Header Name
Zoho-oauthtoken {access_token}


Possible Scope Names (Case Sensitive)
Operation Types
referral, campaign, assessment, vendor, offer,  attachment, 
forecast, note, call, event, task, candidate, jobopening, client, department, interview, contact & custom (for all Custom Modules )
ALL - Full access to the record
READ - Get records from the module

For Authtoken Authentication

Data Type
Encrypted alphanumeric string to authenticate your Zoho credentials. 
Specify the value as recruitapi

Request Parameters

Data Type
Specify the unique ID of the record to which the file has to be attached.
Pass the File Input Stream of the file.
Specify the attachment type (E.g. Resume or Others).
Use version=2: This will fetch responses based on the latest API implementation.
  1. Parameters marked with * are mandatory.
  2. The total file size should not exceed 20 MB.
  3. Your program can request only 15 uploadFile calls per 5 min. If API User requests more than 15 calls, system will block the API access for 15 min. 
  4. If the size exceeds 20 MB, you will receive the following error message: "File size should not exceed 20 MB".
  5. The attached file will be available under the Attachments section in the Record Details Page.
  6. Files can be attached to records in all modules except Reports, Dashboards, and Forecasts.

Java Code to Upload a file for a record

You can run this program in your Java Environment to upload a file to a record.
In the program, you need to specify values for the following:
  1. Your Auth Token
  2. The ID of the Record
  3. The uploadFile Request URL in the format mentioned above
  4. The File Path i.e the location of the File
Code Snippet:
import java.io.*;
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.*;
import org.apache.commons.httpclient.methods.multipart.Part;
import org.apache.commons.httpclient.methods.multipart.FilePart;
import org.apache.commons.httpclient.methods.multipart.StringPart;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
import org.apache.commons.httpclient.methods.multipart.PartSource;
import org.apache.commons.httpclient.methods.multipart.ByteArrayPartSource;
public class UploadFile 
      public static void main(String a[])
                  String auth_token = "USER AUTH TOKEN"; 
                  String auth_scope = "recruitapi";
                  String targetURL = "https://recruit.zoho.com/recruit/private/xml/Candidates/uploadFile";
                  String recordId = "RECORD ID";
                  String file = "FILE NAME
                  File f = new File(file);
                  FileInputStream fis = new FileInputStream(f);
                  ByteArrayOutputStream bos = new ByteArrayOutputStream();
                  int c;
                  while ((c = fis.read()) != -1)
                  byte[] fbArray = bos.toByteArray();
                  targetURL = targetURL + "?authtoken="+ auth_token +"&scope="+ auth_scope+"&version=2";
                  PartSource ps = new ByteArrayPartSource(file,fbArray);
                  PostMethod post =new PostMethod(targetURL);
                  Part[] fields = { new FilePart("content",ps), new StringPart("id", recordId), new StringPart("type", "Cover Letter") };
                  post.setRequestEntity(new MultipartRequestEntity(fields,post.getParams()));
                  HttpClient httpclient = new HttpClient();
                  String postResp = post.getResponseBodyAsString();
                  System.out.println("postResp===========> : "+postResp);
            catch(Exception e)

PHP Code to Upload a file for a record (for PHP versions 5.5 or higher)

Code Snippet:
$recordId="RECORD ID";
$cFile = new CURLFile('/home/path/to/my/file.pdf','application/pdf',")
https://recruit.zoho.com/recruit/private/xml/Candidates/uploadFile?authtoken=<Your Authtoken>&scope=recruitapi&version=2&type=<attachment type>");
echo $response;

Sample Response

<?xml version="1.0" encoding="UTF-8" ?>
<response uri="/recruit/private/xml/Candidates/uploadFile">
            <message>File has been attached successfully</message>
                  <FL val="Id">335751000000578001</FL>
                  <FL val="Created Time">2012-06-20 14:57:34</FL>
                  <FL val="Modified Time">2012-06-20 14:57:34</FL>
                  <FL val="Created By"><![CDATA[krrish]]></FL>
                  <FL val="Modified By"><![CDATA[krrish]]></FL>

Data Storage Limits

Default storage limits for the organization are:
  1. Free Edition - 256 MB for the Org.
  2. Standard Edition - 1GB
  3. Professional Edition - 2GB
  4. Enterprise Edition - 3GB
Extra file storage: USD 3/Month/GB
For the existing users, the revised pricing will be applicable from the next billing cycle.

    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now

            Zoho Sign now offers specialized one-on-one training for both administrators and developers.

            BOOK A SESSION

                                    You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.

                                        Manage your brands on social media

                                          Zoho Desk Resources

                                          • Desk Community Learning Series

                                          • Digest

                                          • Functions

                                          • Meetups

                                          • Kbase

                                          • Resources

                                          • Glossary

                                          • Desk Marketplace

                                          • MVP Corner

                                          • Word of the Day

                                            Zoho Marketing Automation

                                              Zoho Sheet Resources


                                                  Zoho Forms Resources

                                                    Secure your business
                                                    communication with Zoho Mail

                                                    Mail on the move with
                                                    Zoho Mail mobile application

                                                      Stay on top of your schedule
                                                      at all times

                                                      Carry your calendar with you
                                                      Anytime, anywhere

                                                            Zoho Sign Resources

                                                              Sign, Paperless!

                                                              Sign and send business documents on the go!

                                                              Get Started Now

                                                                      Zoho TeamInbox Resources

                                                                              Zoho DataPrep Resources

                                                                                Zoho DataPrep Demo

                                                                                Get a personalized demo or POC

                                                                                REGISTER NOW

                                                                                  Design. Discuss. Deliver.

                                                                                  Create visually engaging stories with Zoho Show.

                                                                                  Get Started Now

                                                                                                      • Related Articles

                                                                                                      • API Methods

                                                                                                        Method Name Purpose getRecords To retrieve all users data specified in the API request getRecordById To retrieve individual records by record ID addRecords To insert records into the required Zoho Recruit module updateRecords To update or modify the ...
                                                                                                      • uploadPhoto

                                                                                                        Purpose You can use this method to upload photos for Candidates or Contacts. Request URL XML Format: For Candidates: https://recruit.zoho.com/recruit/private/xml/Candidates/uploadPhoto?authtoken=AuthToken&scope=recruitapi&id=RecordId&content=File ...
                                                                                                        Wherever you are is as good as
                                                                                                        your workplace



                                                                                                          Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.


                                                                                                          Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.


                                                                                                          Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.

                                                                                                          CRM Tips

                                                                                                          Make the most of Zoho CRM with these useful tips.

                                                                                                            Zoho Show Resources