Get folder list - Get folder list v1
OVERVIEW
This is the first version of this API which was changed in Collaborate 4.1.4 and above
This API method provides a list of folders under a given folder.
Request
GET /api/1/folders/{folderid}/items
Parameters
Parameter Name | Value | Description |
---|---|---|
folderid | Int | The ID for the folder in question |
Query Parameters
Parameter Name | Value | Description |
limit | Int | The no of items to return for this request |
offset | Int | The starting point for each item returned |
orderby | String | The items can be organized by either asc/desc order |
ordertype | String | In addition to the order we can organize items by name/author and last modified date. |
Request body
No request body is required for this call.
Response
If API endpoint returns a 200 OK in case of a successful operation, with the following XML response body:
<folders>
<folder>
<id>3078</id>
<name>My folder for activity</name>
<permission>UPDATE</permission>
<child>0</child>
<description>This is my desc in this folder</description>
<parentFolderID>9</parentFolderID>
<createddate>26 May 2014 06:34</createddate>
<modifieddate>13 Jun 2014 09:03</modifieddate>
<createdby>
<firstname>Tom</firstname>
<lastname>Chick</lastname>
<email>user@highq.com</email>
<userid>103</userid>
</createdby>
<modifiedby>
<firstname>Tom</firstname>
<lastname>Chick</lastname>
<email>user@highq.com</email>
<userid>103</userid>
</modifiedby>
</folder>
<folders>
Parameter Name | Value | Description |
---|---|---|
id | Int | The ID for the folder in question |
name | String | Name of the folder /file |
permission | String | Permission for this item. |
child | String | The no of children under this item |
description | String | The description for this folder item |
parentFolderID | Int | ID of the parent folder |
createddate | Date |
Date is provided in “dd mmm yyyy” format based on UTC timezone.
|
modifieddate | Date | The modified date for this item |
createdby | Object | Details of the person who created this object, this is a cut down user object item |
modifiedby | Object | Details of the person who created this object, this is a cut down user object item |
In case of an error the method returns an error object.
Fernando Deleon in the current implementation by design the expectation is to call the API recursively to get subfolders and files under each folder, this is to avoid overloading the API calls.
Is there a way to fetch all all the subfoldres on the one call to the api say from a root folder to get all the children and subsequent children?
Jim Page the Get site list API gives you the root folder of each site. You can use the filter options to get a specific site or specific list of sites.
Thanks for your prompt reply. I was hoping that could be avoided. Unfortunately, to store and track folders locally with their ID's is less than ideal for us. One possible option would be for us to store the ID of the root folder and then use the 'Get Folder List' API method (possibly repeated times) to traverse the sub folder structure. This would mean we would only need to know the ID of the root folder. So my next question is, how can we identify the ID of the root folder?
Jim Page I am afraid not, as the folder name is not unique in Collaborate. You can have multiple folders with the same name under a given folder. What I can suggest is to store the folder names and their ID's locally and then you can search the folder ID for a specific folder name and use it for any future API calls.
One of our use cases is for our internal application to add files to a folder via the API. For this to work our application would need to know the target folder in each site, possibly by name. This method signature seems to require a folder ID though. Is there a way to achieve this?
Chris Ogram I am afraid its the limitation of the current API, and you will have to call the individual folder info method to get the DMS information, we have noted the request and will address this requirement in the future improvements to the API.
This method does not return any DMS information which means we need to make an additional API call for every folder to check whether it is linked to DMS, this doesn't seem very efficient - is there a better way of doing this? Same question/issue with the files method (list vs. file info). Thanks.
Comments
8 Comments