Upload File
Purpose
To upload a CSV file in ZIP format for bulk write API. The response contains the file_id. Use this ID while making the bulk write request.
Request URL
https://content.zohoapis.com/crm/v2/upload
Request Method
POST
Scope
scope=ZohoFiles.files.ALL
Request Headers
| Header Name | Value | Description |
|---|---|---|
| feature | bulk-write | To indicate that this a bulk write operation |
| X-CRM-ORG | zgid | The unique ID (zgid) of your organization obtained through the Organization API |
Parameters
| Parameter Name | Data Type | Description |
|---|---|---|
| file (mandatory) | file | Choose the zip file you want to upload |
Possible Errors
| Error | Message | Reason |
|---|---|---|
| INVALID_FILE_FORMAT | invalid file format. only zip format is supported | The file you uploaded is not in the zip format. |
| FILE_TOO_LARGE | File size too large to process | The file size is greater than 25MB |
Note:
Refer Limitations to know the CSV file limits.
Sample Request
In the input, "@file.csv.zip" contains the CSV file in ZIP format.
curl "https://content.zohoapis.com/crm/v2/upload"
-X POST
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-H "X-CRM-ORG: 56xxxx47"
-H "feature: bulk-write"
-F "file=@file.csv.zip" Sample Response
{
"status": "success",
"code": "FILE_UPLOAD_SUCCESS",
"message": "file uploaded.",
"details": {
"file_id": "111111000001492610",
"created_time": "2018-12-31T12:00:00-12:00"
}
} Sample Request
ZCRMBulkWrite writeIns = ZCRMRestClient.GetInstance().GetBulkWriteInstance();// To get ZCRMBulkWrite instance
Dictionary<string,string> headers = new Dictionary<string, string>();
headers.Add("X-CRM-ORG", "6045"); // The unique ID (zgid) of your organization obtained through the Organization API
headers.Add("feature", "bulk-write");// To indicate that this a bulk write operation
APIResponse resp = writeIns.UploadFile("/Users/Documents/filename.zip", headers); // To give the zip file and headers you want to upload. Sample Response
{
"status": "success",
"code": "FILE_UPLOAD_SUCCESS",
"message": "file uploaded.",
"details": {
"file_id": "111111000001492610",
"created_time": "2018-12-31T12:00:00-12:00"
}
}