Get files list - Get files list v2
OVERVIEW
Note: The latest specification for Collaborate 4.1.4 and above is here
API method to get a list of files from Collaborate. The file list can be filtered using a search query.
HTTP URL
GET /files
Parameters:
Parameter Name | Type | Detail | |
---|---|---|---|
limit | int | Optional | No of items to returned |
offset | int | Optional | Starting point of the returned items. This should be the item ID. |
ordertype | String | Optional | can be one of name, size, author, lastModified, filetype |
orderby | string | Optional | This is the order of the items returned. Possible values are "Asc" , "desc" , Default is Desc, which means that the latest items are returned first. |
q | string | Mandatory | query to filter out results, please check the search query details for specification of the "q" parameter |
Search Query Parameters:
The search query consists of three parts
- Field : field specifying the search criteria. e.g site
- Operator : Test or condition that has to be performed on the data to create a filter
- Value : The content of the attribute that is to be tested, e.g folderid = 217
The representation of q parameter works as under
q = "folderid=1"
Where q parameter is in double quotes and is URL encoded.
Fields | Value Type | Operator | Description |
---|---|---|---|
FolderId | int | = | ID of the parent folder for which the list of files is required |
With the current implementation of the files list API the q parameter only supports folderid, this parameter will be extended in the future implementations of the file list API to support a more detailed search criteria.
Response XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<files>
<filetotal>Total no of files satisfying this search criteria</filetotal>
<file>
<name>RRRRRRRRRR</name>
<id>868</id>
<versionid>1</versionid>
<createddate>20 Jun 2014 10:06</createddate>
<modifieddate>20 Jun 2014 10:06</modifieddate>
<type>pdf</type>
<size>775702</size> <!--(unit is in bytes) Supported from 4.0.3 branch -->
<folderid>123</folderid>
<siteid>234</siteid>
<location>folder1/folder2</location> <!-- support from 4.0.3 branch -->
<icon>http://clientinstance.highq.com/clientinstance/images/fileicon/pdf.png</icon>
<commentscount>0</commentscount>
<likescount>0</likescount>
<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>
<permission>
<view>1</view> <edit>1</edit> <!-- support from 4.0.3 branch -->
<delete>1</delete>
</permission>
</file>
</files>
Notes:
- All dates are in UTC.
- In this phase we are only supporting folderid in q parameter
- eg: q="folderid=12"
- The default value for limit is 100
- if limit>0 then (number of return data = limit)
- if limit=-1 then return all data
- if limit<-1 then default value of the limit will be returned, which is 100
- The default value of offset is 0
- if offset>0 the starting point will be the offset value.
- if offset<0 then the default value of 0 will be used by the system
- The default value of orderby parameter is descending (desc)
- The default value for ordertype parameter is creation date
- <filetotal> element show total number of files contained in folder
- "size" is returned depending on size configuration at site level, "size" is in Bytes.
- Permissions, size and location parameter has been added to the response in Collaboarate 4.0.3
- The permission element represents the callers permissions to the specific file.
Code | Meaning |
---|---|
200 | Get File List successfully |
400 | Problem with parsing XML or JSON object (Bad Request) |
401 | Unauthorized |
403 | Validation failed/ Forbidden |
405 | Method not allowed (calling api with wrong method) |
500 | Internal error occurred |
Is it possible to fetch a list with ALL files in a site?
Comments
1 Comments