Use this operation to view the first 50 versions of a shared file or a file that resides within a shared folder in an ObjectStore based on the file path. The versions are listed in descending order so that the latest version is the top result.
Request
Syntax
GET <webservice>/contentstore/share/{shareId}/file/versions?path={filePath} HTTP/1.1
Host: <host name>
Accept: {application/xml | application/json}
Authtoken: <authentication token>
where <webservice> is the root path used to route the API requests to the Web Server.
For more information, see Available Web Services for REST API.
Request Parameters
Name | Description | Required |
shareId | The unique identifier (syncWebFolderId response) returned when you share a file or folder or view the shared files and folders. If the shareId is not known, see View Shared Files and Folders to retrieve it. | Yes |
filePath | The path to the file. Specify the path relative from the root. Note: The path must be URL encoded before they are sent in the request. | Yes |
Request Headers
Name | Description |
Host | The host name of the Web Server or Web Console used in the API request. |
Accept | The format of the response. Valid values are: application/xml or application/json. |
Authtoken | The authentication token received after successfully logging on. For details on receiving an authentication token, see Authentication. |
Response
Response Parameters
Parameter | Description | Element |
owner | The user who shared the file. | fileResources |
modifiedTime | The last modified time of the file. | fileResources |
previewUrl | The URL for previewing the file. By default, a relative URL is returned. | fileResources |
parentPath | The path to the parent folder, relative from the share root path. | fileResources |
downloadUrl | The URL for downloading the file. By default, a relative download URL is returned. To generate the complete URL for download, see Generating Full Download URLs. | fileResources |
versionGUID | The GUID of the file version. | fileResources |
parentGuid | The GUID of the parent folder. | fileResources |
GUID | The GUID of the latest version of the file. | fileResources |
name | Name of the file. | fileResources |
file | 'file=1' indicates the request item is a file. | fileResources |
path | The path to the file, relative from the share root path. | fileResources |
sizeinBytes | The size of the file. | fileResources |
Examples
Sample Request
GET <webservice>/contentstore/share/179566/file/versions?path=\DemoFile1.doc HTTP/1.1
Host: client.mydomain.com
Accept: application/json
Authtoken: QSDK 38568012f4d1e8ee1841d283a47aa3ba78e124ea58354b5fc6
0f4dab8a63347d05cf5552484dafda3bfa4c5db84e580b1cb37bcf8e65b39f7f
8549a443e6f78a2c7be3f31b3d845e24776c835e498e8e883bb40c46bd15af4f
40ca94e823acedcdd4e9659e74b34a07a85c4586cd2ed914b6dce015874783ef7
68fda78183a4208930954a377f66eb56c8b92cexampl4s437a19317ca6ce7f323
3d5a01aca35dbad93468b833f2cf71010809006a937670adce711ca8be46638e8
Sample Response
JSON
{
"fileResources": [
{
"owner": "(jdoe@mycompany.com)",
"modifiedTime": 1481595468,
"previewUrl": "/drive/file/version/e6c98f8d232cf89ac745621cf165977d/action/preview",
"parentPath": "\\DemoShareFolder",
"GUID": "d73788d23f274840b3b3703e3d070f93",
"sizeinBytes": 17,
"downloadUrl": "/drive/file/version/e6c98f8d232cf89ac745621cf165977d/action/download",
"directory": false,
"versionGUID": "e6c98f8d232cf89ac745621cf165977d",
"path": "\\DemoShareFolder\\DemoFile1.doc",
"file": true,
"parentGuid": "1898de86bca04837a67c335978a34d9d",
"name": "DemoFile1.doc"
}
]
}
{
"fileResources": [
{
"owner": "(jdoe@mycompany.com)",
"modifiedTime": 1481595493,
"previewUrl": "/drive/file/version/e6c98f8d232cf89ac745621cf165977d/action/preview",
"parentPath": "\\DemoShareFolder",
"GUID": "d73788d23f274840b3b3703e3d070f93",
"sizeinBytes": 18,
"downloadUrl": "/drive/file/version/e6c98f8d232cf89ac745621cf165977d/action/download",
"directory": false,
"versionGUID": "e6c98f8d232cf89ac745621cf165978d",
"path": "\\DemoShareFolder\\DemoFile1.doc",
"file": true,
"parentGuid": "1898de86bca04837a67c335978a34d9d",
"name": "DemoFile1.doc"
}
]
}
XML
<App_FileResourceListResponse>
<fileResources owner="(jdoe@mycompany.com)" modifiedTime="1481595468" previewUrl="/drive/file/version/5b2752803d1dce3d2939300df592c5ee/action/preview" parentPath="\DemoShareFolder" GUID="b235825280f346ccba8faaad9df77d82" sizeinBytes="17" downloadUrl="/drive/file/version/5b2752803d1dce3d2939300df592c5ee/action/download" directory="0" versionGUID="5b2752803d1dce3d2939300df592c5ee" path="\DemoShareFolder\DemoFile1.doc" file="1" parentGuid="91f31e346319464daeafa80abf725fca" name="DemoFile1.doc" />
</App_FileResourceListResponse><App_FileResourceListResponse>
<fileResources owner="(jdoe@mycompany.com)" modifiedTime="1481595493" previewUrl="/drive/file/version/5b2752803d1dce3d2939300df592c5ee/action/preview" parentPath="\DemoShareFolder" GUID="b235825280f346ccba8faaad9df77d82" sizeinBytes="18" downloadUrl="/drive/file/version/5b2752803d1dce3d2939300df592c5ee/action/download" directory="0" versionGUID="5b2752803d1dce3d2939300df592c5cc" path="\DemoShareFolder\DemoFile1.doc" file="1" parentGuid="91f31e346319464daeafa80abf725fca" name="DemoFile1.doc" />
</App_FileResourceListResponse>
Supported Error Codes
Code | Status | Description |
---|---|---|
400 | Bad Request | The request is missing required parameters or the file/folder name has some unacceptable characters. |
403 | Forbidden | The user does not have access to the share or the file/folder requested is not accessible inside the share. |
404 | Not Found | The specified file or folder does not exist. |