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 Details

Request URL

https://content.zohoapis.com/bigin/v1/upload

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

feature: bulk-write - To indicate this is a bulk write job

X-CRM-ORG: zgid - The unique ID (zgid) of your organization obtained through the Organization API

Scope

scope=ZohoFiles.files.ALL

Input form-data

  • filefile, mandatory

    Choose the zip file you want to upload.

Sample Request

Copiedcurl "https://content.zohoapis.com/bigin/v1/upload"
-X POST
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-H "X-CRM-ORG: 56xxxx47"
-H "feature: bulk-write"
-F "file=@file.csv.zip"
CopiedZBiginBulkWrite writeIns = ZBiginRestClient.GetInstance().GetBulkWriteInstance();// To get ZBiginBulkWrite 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.

Possible Errors

  • INVALID_FILE_FORMATHTTP 200

    The file you uploaded is not in the zip format.
    Resolution: Upload the file only in the zip format.

  • FILE_TOO_LARGEHTTP 200

    The file size is too large to process.
    Resolution: The maximum file size is 25MB.

Note

Refer to the Limitations to know the CSV file limits.

Sample Response

Copied{
    "status": "success",
    "code": "FILE_UPLOAD_SUCCESS",
    "message": "file uploaded.",
    "details": {
        "file_id": "111111000001492610",
        "created_time": "2018-12-31T12:00:00-12:00"
    }
    }