View Versions of a File in ObjectStore Public Share Using ID (REST API: GET)

Updated

Use this operation to view all the versions of a public shared file or a file that resides within a public shared folder in an ObjectStore based on the GUID of the file. The versions are listed in descending order so that the latest version is the top result.

Request

Syntax

GET <webservice>/contentstore/publicshare/{shareId}/file/{fileId}/versions HTTP/1.1

Host: <host name>

Accept: {application/xml | application/json}

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

filed

The GUID of the file. GUID is a unique identifier for a file or folder and remains the same even when you rename or move the file or folder to another path.

To retrieve the GUID of the file or folder, see View ObjectStore File Properties.

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.

Response

Response Parameters

Parameter

Description

Element

owner

The user who shared the file.

fileReferences

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/publicshare/372441/file/b89a9355129c4ad2981a55d933236a9c/versions HTTP/1.1

Host: client.mydomain.com

Accept: application/json

Sample Response

JSON

{

"fileResources": [

{

"owner": "(jdoe@mycompany.com)",

"modifiedTime": 1481595468,

"previewUrl": "/drive/file/version/aa10ebe048913954bc54b54b2203a3bd/action/preview",

"parentPath": "\\DemoPublicShare",

"GUID": "b89a9355129c4ad2981a55d933236a9c",

"sizeinBytes": 17,

"downloadUrl": "/drive/file/version/aa10ebe048913954bc54b54b2203a3bd/action/download",

"directory": false,

"versionGUID": "aa10ebe048913954bc54b54b2203a3bd",

"path": "\\DemoPublicShare\\DemoFile1.doc",

"file": true,

"parentGuid": "3221b1818c794cd5815a1378b65d99d7",

"name": "DemoFile1.doc"

}

]

}

{

"fileResources": [

{

"owner": "(jdoe@mycompany.com)",

"modifiedTime": 1481595493,

"previewUrl": "/drive/file/version/aa10ebe048913954bc54b54b2203a3bd/action/preview",

"parentPath": "\\DemoPublicShare",

"GUID": "b89a9355129c4ad2981a55d933236a9c",

"sizeinBytes": 18,

"downloadUrl": "/drive/file/version/aa10ebe048913954bc54b54b2203a3bd/action/download",

"directory": false,

"versionGUID": "aa10ebe048913954bc54b54b2203a4bd",

"path": "\\DemoPublicShare\\DemoFile1.doc",

"file": true,

"parentGuid": "3221b1818c794cd5815a1378b65d99d7",

"name": "DemoFile1.doc"

}

]

}

Sample Response

XML

<App_FileResourceListResponse>

<fileResources owner="(jdoe@mycompany.com)" modifiedTime="1481595468" previewUrl="/drive/file/version/1e89dfdddc18b4df357b99656ce7c355/action/preview" parentPath="\DemoPublicShare" GUID="b59a7b6f29274ddb8cec05133139b166" sizeinBytes="17" downloadUrl="/drive/file/version/1e89dfdddc18b4df357b99656ce7c355/action/download" directory="0" versionGUID="1e89dfdddc18b4df357b99656ce7c355" path="\DemoPublicShare\DemoFile1.doc" file="1" parentGuid="6ad7aa6b06694440a3982a700b67ac2d" name="DemoFile1.doc" />

</App_FileResourceListResponse><App_FileResourceListResponse>

<fileResources owner="(jdoe@mycompany.com)" modifiedTime="1481595493" previewUrl="/drive/file/version/1e89dfdddc18b4df357b99656ce7c355/action/preview" parentPath="\DemoPublicShare" GUID="b59a7b6f29274ddb8cec05133139b166" sizeinBytes="18" downloadUrl="/drive/file/version/1e89dfdddc18b4df357b99656ce7c355/action/download" directory="0" versionGUID="1e89dfdddc18b4df357b99656ce7c356" path="\DemoPublicShare\DemoFile1.doc" file="1" parentGuid="6ad7aa6b06694440a3982a700b67ac2d" 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.