Fetch files from a folder
Overview
This task is used to fetch details of all the files present in a specified folder in your Zoho Docs account.
Syntax
<response> = zoho.docs.getFiles(<folderID>);
where,
Parameters | Description | Data 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"
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:
for each var1 in var
{
info var1.getJson("DOCID");
}