Upload Files to Zoho File System (ZFS)
Purpose
ZFS is the central storage system to all your files and attachments. Use this API to upload fields to ZFS. This API returns an encrypted file ID and the file name. You can use this encrypted ID to attach this file to a file/image upload field or a record in Zoho CRM. You must upload the file with content type as multipart/form data.
Request URL
https://www.zohoapis.com/crm/v2/files
Request Method
POST
Scope
scope=ZohoCRM.Files.CREATE
Parameters
| Parameter Name | Data Type | Description | Possible Values |
|---|---|---|---|
| type (optional) | String | To upload inline images. | The value is inline. |
Possible Errors
| HTTP Status | Error Code | Message | Reason |
|---|---|---|---|
| 400 | failure_in_attachment_handling | Problem in uploading attachment. kindly upload the file properly | There was a trouble establishing a connection with the ZFS. Try again after sometime. |
| 400 | VIRUS_DETECTED | Unable to process your request. Virus has been detected. | A virus is found in the file that you uploaded. Upload a file without any viruses. |
Note
The maximum size of each attachment is 20MB.
Sample Request
curl "https://www.zohoapis.com/crm/v2/files"
-X POST
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-F "file=@connections.txt"
-F "file=@enable-signals.png" Sample Response
{
"data": [
{
"code": "SUCCESS",
"details": {
"name": "connections.txt",
"id": "2cceafaxxxxxxxc065186"
},
"message": "connections.txt uploaded Succeessfully",
"status": "success"
},
{
"code": "SUCCESS",
"details": {
"name": "enable-signals.png",
"id": "2ccxxxxxxxxxxxb89e051a"
},
"message": "enable-signals.png uploaded Succeessfully",
"status": "success"
}
]
} Sample request to add an inline image
curl "https://www.zohoapis.com/crm/v2/files?type=inline"
-X POST
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-F "file=@webapp_create1.png" Sample Response
{
"data": [
{
"code": "SUCCESS",
"details": {
"name": "webapp_create1.png",
"id": "2cceafa194d037b63f2000181dd818646fd5e5167a274098b625c35654a20ed2"
},
"message": "webapp_create1.png uploaded Succeessfully",
"status": "success"
}
]
}