Choose where you’d like to start

Fetch files from a folder

Note: As previously announced, Zoho Docs is being discontinued and the Deluge Docs integration tasks will stop executing starting 15th September 2023. For your advanced file management and collaboration requirements, we recommend you refer to the WorkDrive API documents as an alternative.

Overview

This task is used to fetch details of all the files present in a specified folder in your Zoho Docs account.

Note: On average, it takes about a minute to index a file/folder after it is created or updated. This indexing time can increase if the queue size increases. You will not get the expected result if you execute zoho.docs.getFiles task before the files you need to fetch are indexed.

Syntax

<response> = zoho.docs.getFiles(<folderID>);

where,

ParametersDescriptionData Type

<response>

Variable which will hold the response returned by Zoho Docs. It contains folder and file related information such as File ID (doc ID), created time, modified time, author ID etc.

KEY-VALUE

<folderID>

ID of the folder from which details of files will be retrieved.

The Folder ID can be viewed in the url when clicked on the folder in Zoho Docs.

Folder IDs are also present in the response of retrieveFiles() task

TEXT

Example 1:

The following script fetches details of all the files from the specified folder in Zoho Docs.

response= zoho.docs.getFiles("0kav58698776c2a8b465f86b5efef876c7d3b");

where,

"0kav58698776c2a8b465f86b5efef876c7d3b"
is the ID of the folder from which the files have to be retrieved. It is of TEXT data type.

Response

The success response returned is of the following format:

{  
   "FILES":[  
      {  
         "AUTHOR":"John Mathews",
         "AUTHOR_EMAIL":"john.mathews@zylker.com",
         "LAST_MODIFIEDTIME_IN_MILLISECONDS":1371015460774,
         "SCOPE":0,
         "FILE_EXTN":"jpg",
         "DOCID":"8tw2gf0022bc32fb94c4990f40658dd091983",
         "DOCNAME":"Chrysanthemum.jpg",
         "FOLDER_ID":"folder",
         "LAST_MODIFIEDTIME":"Jun 11",
         "SERVICE_TYPE":"upload",
         "IS_LOCKED":false,
         "FILETYPE":"image"
      }
   ]
}


To fetch File IDs from the response, use the following snippet:

var = <response_variable>.get("FILES");
for each var1 in var
{
info var1.getJson("DOCID");
}

Get Started Now

Execute