Documents and Folders API
All documents GET /restapi/portal/[PORTALID]/projects/[PROJECTID]/documents/ |
Version details of the document GET /restapi/portal/[PORTALID]/projects/[PROJECTID]/documents/[DOCUMENTID]/ |
Add document POST /restapi/portal/[PORTALID]/projects/[PROJECTID]/documents/ |
Upload a document to the project POST /restapi/portal/[PORTALID]/projects/[PROJECTID]/documents/[DOCUMENTID]/ |
Delete document DELETE /restapi/portal/[PORTALID]/projects/[PROJECTID]/documents/[DOCUMENTID]/ |
All folders GET /restapi/portal/[PORTALID]/projects/[PROJECTID]/folders/ |
Add an inline attachment POST /restapi/portal/[PORTALID]/inline-attachments |
All documents
Gets all the documents in the given project.
GET /restapi/portal/[PORTALID]/projects/[PROJECTID]/documents/
Scope: ZohoProjects.documents.READ, ZohoPC.files.READ
Request parameters
index | int | Index number of the document. |
range | int | Range of the documents. |
folder_id | Long | ID of the project folder. |
sort_column | String | Sort based on date order, kind or name. |
sort_order | String | Specify the sorting order(ascending or descending). |
category | String | Document category. Example: all, documents, spreadsheets, presentations, pdf, images, audio, videos |
action | String | Range of the documents. |
Sample response
Status: 200 Success Content Type: application/json;charset=utf-8
{ "parent_name": "SAP Phase", "encattr_parent_name": "SAP Phase", "total_resources": [ { "no_of_res": 1 } ], "preference": { "layout": "thumbnail", "sort_by": "dateorder", "filters": [ { "name": "all", "show": true, "display_name": "All" }, { "name": "documents", "show": true, "display_name": "Documents" }, { "name": "spreadsheets", "show": true, "display_name": "Spreadsheets" }, { "name": "presentations", "show": true, "display_name": "Presentations" }, { "name": "pdf", "show": false, "display_name": "PDF" }, { "name": "images", "show": false, "display_name": "Images" }, { "name": "audio", "show": false, "display_name": "Audio" }, { "name": "videos", "show": false, "display_name": "Videos" } ], "sort_order": "desc" }, "dataobj": [ { "split": true, "split_value": "Earlier" }, { "is_rename": false, "author_name": "Patricia Boyle", "is_res_shared": false, "encattr_res_name": "business_manual.pdf", "is_locked": false, "is_favorite": false, "encattr_author_name": "Patricia Boyle", "is_fol_author": false, "res_size": "", "res_name": "business_manual.pdf", "last_modified_by_name": "Patricia Boyle", "encurl_res_name": "business_manual.pdf", "docs_preview_url": "https://docs.zoho.com/thumbnail/voo1nf3254dd11ac54199a5eca4500eb7dcdc?width=350&height=262", "created_time_milliseconds": 1399620397255, "no_preview_class": "pdf-thumb-icon pdf-thumb-cus", "library_id": "voo1nf8ad126663d6482faaec69bfc4722a19", "shared_time": "May 9, 2014", "res_id": "voo1nf3254dd11ac54199a5eca4500eb7dcdc", "download_url": "https://download-accl.zoho.com/webdownload?x-service=EX&event-id=voo1nf3254dd11ac54199a5eca4500eb7dcdc_1564402365136&x-cli-msg=%7B%22x-encoding%22%3A%22gzip%22%2C%22x-resource_id%22%3A%22voo1nf3254dd11ac54199a5eca4500eb7dcdc%22%7D", "is_devfile": false, "encauthor_name": "Patricia Boyle", "is_media": false, "class_name": "icon-pdf grid-icons", "created_time": "May 9, 2014", "enc_res_name": "business_manual.pdf", "is_active": false, "last_modified_time": "May 9, 2014", "is_folder": false, "encurl_author_name": "Patricia+Boyle", "docs_download_url": "https://docs.zoho.com/api/v2/files/download?resourceId=voo1nf3254dd11ac54199a5eca4500eb7dcdc", "last_opened_time": "May 9, 2014", "last_modified_by": "2060758", "last_modified_time_milliseconds": 1399620397255, "splitvalue": "Earlier", "res_extn": "pdf", "res_type": "pdf", "service_type": "upload", "last_modified_by_encattr_author_name": "Patricia Boyle", "is_video": false, "is_audio": false, "mime_type": "application/pdf", "parent_id": "voo1n2b7c89dc03bd48df9ffc7113c6e2c1cb", "preview_url": "https://download.zoho.com/webdownload?x-service=EX&event-id=voo1nf3254dd11ac54199a5eca4500eb7dcdc_350x262&x-cli-msg=%7B%22x-h%22%3A262%2C%22x-w%22%3A350%2C%22x-mode%22%3A%222%22%2C%22x-encoding%22%3A%22gzip%22%2C%22x-resource_id%22%3A%22voo1nf3254dd11ac54199a5eca4500eb7dcdc%22%7D", "last_modified_by_author_name": "Patricia Boyle", "last_opened_time_milliseconds": 1399620397255, "author_id": "2060758", "space_id": "2063927", "is_res_viewed": true } ], "ws_type": "crmworkspace", "enc_parent_name": "SAP Phase", "display_fields": [] }
Version details of the document
Fetch the version details of the document.
GET /restapi/portal/[PORTALID]/projects/[PROJECTID]/documents/[DOCUMENTID]/
Scope: ZohoProjects.documents.READ, ZohoPC.files.READ
Request parameters
version | String | Version of the document. |
Sample response
Status: 200 Success Content Type: application/json;charset=utf-8
{ "is_rename": false, "author_name": "Helen Collins", "is_res_shared": false, "is_locked": false, "is_fol_author": true, "res_size": 104600, "is_favourite": false, "res_name": "1992a53f-2610-4904-8476-61f46d713930.jpeg", "last_modified_by_name": "Helen Collins", "last_opened_time_in_millis": 1544101262060, "last_modified_time_in_millis": 1495794822783, "no_preview_class": "image-thumb-icon image-thumb-cus", "shared_time": "May 26, 2017", "res_id": "2or01ecb158feb2a64d98b49ff60e3bf51b2c", "scope": 0, "download_url": "https://download.zoho.com/webdownload?x-service=EX&event-id=2or01ecb158feb2a64d98b49ff60e3bf51b2c_1544101262060&x-cli-msg=%7B%22x-encoding%22%3A%22gzip%22%2C%22x-resource_id%22%3A%222or01ecb158feb2a64d98b49ff60e3bf51b2c%22%7D", "is_devfile": false, "is_media": false, "class_name": "icon-pic grid-icons", "created_time": "May 26, 2017", "enc_res_name": "1992a53f-2610-4904-8476-61f46d713930.jpeg", "is_active": false, "last_modified_time": "May 26, 2017", "shared_type": "", "is_folder": false, "parent_folder_id": "2or018452a93706e549ef9858994a9a3accf4", "last_opened_time": " few seconds ago", "permission": 0, "last_modified_by": "639283127", "folder_name": "1992a53f-2610-4904-8476-61f46d713930.jpeg", "splitvalue": "Today", "res_extn": "jpeg", "res_type": "image", "folder_level": "", "service_type": "upload", "is_video": false, "is_audio": false, "mime_type": "image/jpeg", "preview_url": "https://download.zoho.com/webdownload?x-service=EX&event-id=2or01ecb158feb2a64d98b49ff60e3bf51b2c_200x150&x-cli-msg=%7B%22x-h%22%3A150%2C%22x-w%22%3A200%2C%22x-mode%22%3A%222%22%2C%22x-encoding%22%3A%22gzip%22%2C%22x-resource_id%22%3A%222or01ecb158feb2a64d98b49ff60e3bf51b2c%22%7D", "created_time_in_millis": 1495794822757, "author_id": "639283127", "folder_id": "2or018452a93706e549ef9858994a9a3accf4", "space_id": "2063927", "status": 1, "is_res_viewed": true }
Add document
Add a document.
POST /restapi/portal/[PORTALID]/projects/[PROJECTID]/documents/
Scope: ZohoProjects.documents.CREATE, ZohoPC.files.CREATE
Request parameters
uploaddoc* | File | The selected file for upload. |
folder_id | Long | ID of the project folder. |
description | String | Description of the document. |
tags | String | Document tags must be separated by space or comma. |
notify | Long | User ID's must be separated by commas for multiple users. |
Sample response
Status: 201 Created Content Type: application/json;charset=utf-8
[ { "name": "wallpaper2you_276334.jpg,", "id": "aw6c24f45cf4dd9484831a36ab521d71045aa," } ]
Upload a document to the project
Uploads a document to the project.
POST /restapi/portal/[PORTALID]/projects/[PROJECTID]/documents/[DOCUMENTID]/
Scope: ZohoProjects.documents.UPDATE, ZohoPC.files.CREATE
Request parameters
uploaddoc* | File | The selected file for upload. |
folder_id | Long | ID of the project folder. |
description | String | Description of the document. |
tags | String | Document tags must be separated by space or comma. |
notify | Long | User ID's must be separated by commas for multiple users. |
Sample response
Status: 201 Created Content Type: application/json;charset=utf-8
[ { "name": "inspirational-quotes-1.jpg,", "id": "2or01ecb158feb2a64d98b49ff60e3bf51b2c," } ]
Delete a document
Deletes the document.
DELETE /restapi/portal/[PORTALID]/projects/[PROJECTID]/documents/[DOCUMENTID]/
Scope: ZohoProjects.documents.DELETE, ZohoPC.files.DELETE
Sample response
Status: 200 Success Content Type: application/json;charset=utf-8
{ "response": "file deleted successfully" }
All folders
Returns all the folders from the project specified.
GET /restapi/portal/[PORTALID]/projects/[PROJECTID]/folders/
Scope: ZohoProjects.documents.READ, ZohoPC.files.READ
Sample response
Status: 200 Success Content Type: application/json;charset=utf-8
{ "folders": [ { "author_name": "", "is_res_shared": false, "encattr_res_name": "Discussion", "enc_res_name": "Discussion", "shared_users": [], "parent_folder_id": "crmworkspace", "is_folder": true, "encattr_author_name": "", "subfolder": false, "opened": true, "res_name": "Discussion", "encurl_res_name": "Discussion", "fetched_data": false, "enc_author_name": "", "res_type": "folder", "is_opened": false, "children": [], "res_id": "2or0132d8c9460ea3419cbaad247be49d1df3", "scope": 0, "author_id": "639283127" } ] }
Add an inline attachment
Allows the user to add an image as an inline attachment in all the modules.
POST /restapi/portal/[PORTALID]/inline-attachments
Scope: ZohoProjects.portals.READ
Request parameters
upload_file | File | Adds the image. Allowed extensions
|
Sample response
Status: 200 Success Content Type: application/json;charset=utf-8
{ "inline_attachments": [ { "content_type": "image/jpeg", "name": "wallpaper.jpg", "id": 4596746000000102000, "url": "https://projects.zoho.com/viewInlineAttachmentForApi/image?file=90f29343b33b4e17a049296116cbe2da083928986c78a4dc4f65ac2ad0fc231a98aa05b860ab797df4340f2fd58c4cfa" } ] }