Get file info
OVERVIEW
This is the latest version of this API endpoint valid from Collaborate 4.1.4 and above, for older versions please see the child pages of this page
Get a file’s metadata given the file ID.
Request
GET /api/1/files/{fileid}
Parameters
Parameter Name | Value | Description |
---|---|---|
fileid | Int | The ID for the file in question |
lastdmsinfo (This is a query string parameter) | true/false | This parameter is supported from Collaborate version 3.4.5. Default is false. Setting this parameter returns the last added DMS version with a given Collaborate version of the document. |
Request body
Do not supply a request body with this method.
Response
If successful this method returns a file resource in the response body.
Parameter Name | Value | Description |
---|---|---|
folderid | Int | The id of the folder in which the file exists |
id | Int | The ID for the file in question |
name | String | Name of the file |
versionid | Int | Collaborate file version |
versionnote | String | Any version notes provided for the file |
createddate | Date | Date is provided in “dd mmm yyyy” format based on UTC timezone |
modifieddate | Date |
Date is provided in “dd mmm yyyy” format based on UTC timezone. Author, creation and modified date is provided based on site settings |
type | String | Information stating the type of file |
icon | String | URL to the file icon, this will bypass the security so that the API end user can obtain the file icon if required. (API endpoint for file icon will be provided in future releases) |
originaltype | String | The original type of the file before conversion ( if any ). Originaltype will be shown when site level configuration for Enable automatic PDF conversion = true or Online viewer with DRM = true or Convert all files to PDF and encrypt with FileOpen plugin =true or (Encrypt PDF files with FileOpen plugin = true and file is PDF) |
size | int | size in bytes. "size" is based on show size configuration at site level, "size" is in Bytes |
commentscount | Int | Number of comments for the file |
likescount | Int | No of likes for the file. Likes should be enabled for the instance and the user should not be a bidder user, otherwise the returned value will be 0 |
tags | String | Tags for the file |
location | String | Full path to the file location in Collaborate including site name |
dms | Object | Detailed related to the DMS from where the file was added. |
createdby | Object | User object for the person who created this file |
modifiedby | Object |
User object for the person who modified this file |
contentstatus | Int | Provides status information for the file, a value of 0 indicates that the file has been deleted, and is placed in the recycle bin |
Response XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<file>
<folderID>3075</folderID>
<name>RRRRRRRRRR</name>
<id>868</id>
<siteid>2</siteid> <!-- Supported from 4.0.3 branch -->
<versionid>1</versionid>
<versionnote></versionnote>
<createddate>20 Jun 2014 10:06</createddate>
<modifieddate>20 Jun 2014 10:06</modifieddate>
<type>pdf</type>
<originaltype>txt</originaltype>
<size>13878</size>
<icon>https://domain.com/instancename/images/fileicon/pdf.png</icon>
<commentscount>0</commentscount>
<likescount>0</likescount>
<tags>
<tag>asdf</tag>
<tag>asfn</tag>
</tags>
<location>Deleted Items</location>
<dms>
<dmsdocid>23</dmsdocid>
<dmsParentFolderID>55</dmsParentFolderID>
<dmscreateddate>2014-06-20T10:06:14.770+05:30</dmscreateddate>
<dmsmodifiedBy>103</dmsmodifiedBy>
<dmsdatabasename>user</dmsdatabasename>
<dmsversion>1</dmsversion> <!-- support from 3.4.5 branch -->
</dms>
<createdby>
<firstname>firstname</firstname>
<lastname>lastname</lastname>
<email>first.last@highq.com</email>
<userid>103</userid>
</createdby>
<modifiedby>
<firstname>first</firstname>
<lastname>last</lastname>
<email>first.last@highq.com</email>
<userid>103</userid>
</modifiedby> <contentstaus>0</contentstatus> <!-- (Tag has been added in 4.1.3 ) -->
<permission>
<view>1</view>
<edit>1</edit> <!-- support from 4.0.3 branch -->
<delete>1</delete>
</permission>
</file>
- "originaltype" field will hold a value when site level configuration for Enable automatic PDF conversion = true or Online viewer with DRM = true or Convert all files to PDF and encrypt with FileOpen plugin = true or (Encrypt PDF files with FileOpen plugin = true and file is PDF)
- "size" field is populated depending on the "show size" configuration at site level, "size" is in Bytes. If this configuration is set to false, no size information will be provided through the API.
- Query params 'lastdmsinfo' is support from Collaborate 3.4.5 branch. It accepts true/false value. By default false. If this value is set as true then response will have last added dms version <dms> information. Current file version does not have bounded <dms> information.
- The siteID and permission fields have been added to the response from Collaborate 4.0.3
Code | Meaning |
---|---|
401 | Unauthorized |
403 | Validation failed/ Forbidden |
405 | Method not allowed (calling api with wrong method) |
500 | Internal error |
Andrew Quinn Oh I see, thanks for raising the issue, I will raise a bug report. Thanks
Hi Imran Aziz, there appears to be a minor bug in this endpoint, in Collaborate 4.4.6.1, the "icon" field in the response is always:
https://*****.highq.com/*****/images/fileicon/large_default.svg
regardless of file type. For now, as a temporary solution, we simply replace "large_default" with "large_
Thanks, Andrew
Egbert van der Wal the file ID and folder ID are from different sequences and have no relationship to each other.
Imran Aziz are file IDs and folder IDs from different sequences or the same? E.g. must I assume that the same number could be used both as a file ID and as a folder ID or will it always be one or the other (or none)?
Giuseppe Carafa well the way we have done this in our HighQ Drive application is to use this configuration API to get the system configured time and then convert the UTC to the instance time or local time what ever is required.
Hello Imran Aziz
I have come across an issue with this functionality. I uploaded a file to integrationlive and then retrieved this file information for the same file. I uploaded the file at 15:31, and when I look at it through the web interface it does indeed tell me that it was uploaded at 15:31. However, when I use the API to retrieve the file information, the modifieddate tells me that the file was last modified at 14:31. So I think these times are returned in UTC. Is there a way to get the actual time rather than the UTC time?
Comments
6 Comments