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/

 All documents

Gets all the documents in the given project.

GET  /restapi/portal/[PORTALID]/projects/[PROJECTID]/documents/

Scope: ZohoBugTracker.documents.READ, ZohoPC.files.READ

Request parameters

indexintIndex number of the document.
rangeintRange of the documents.
folder_idLongID of the project folder.
sort_columnStringSort based on date order, kind or name.
sort_orderStringSpecify the sorting order(ascending or descending).
categoryStringDocument category. Example: all, documents, spreadsheets, presentations, pdf, images, audio, videos
actionStringRange of the documents.

Sample response

Status: 200 Success

Content Type: application/json;charset=utf-8
{
  "parent_name": "ZylSoft Mobile App",
  "encattr_parent_name": "ZylSoft Mobile App",
  "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"
    }
   }

 Version details of the document

Fetch the version details of the document.

GET  /restapi/portal/[PORTALID]/projects/[PROJECTID]/documents/[DOCUMENTID]/

Scope: ZohoBugTracker.documents.READ, ZohoPC.files.READ

Request parameters

versionStringVersion 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: ZohoBugTracker.documents.CREATE, ZohoPC.files.CREATE

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: ZohoBugTracker.documents.UPDATE, ZohoPC.files.CREATE

Request parameters

uploaddoc*FileThe selected file for upload.
folder_idLongID of the project folder.
descriptionStringDescription of the document.
tagsStringDocument tags must be separated by space or comma.
notifyLongUser 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: ZohoBugTracker.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: ZohoBugTracker.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"
    }
  ]
}