This endpoint downloads a single user document by its file GUID. Use Retrieve user's documents info first to get the fileGuid for each of a user's documents.


GET api/file/download/file/{fileGuid}/{tenantSubDomainName}/{getThumbnail}/{thumbMode}/{viewInline}


Request

Url Params

All five parameters are required. If any are left off the URL, the request returns 404 Not Found.

fileGuidguidthe unique reference of the file, as returned by Retrieve user's documents info
tenantSubDomainNamestringsubdomain name of the tenant the file belongs to (see Permissions)
getThumbnailbooleanuse false to download the full file
thumbModestringuse gallery
viewInlinebooleanuse false to return the file as a download


For a standard document download, use the defaults: getThumbnail = false, thumbMode = gallery, viewInline = false.


Authorization

To download a private file, the request must be authenticated with a 'Bearer Token' authorisation header.

Tokensee How to get a bearer token


Response

If the request is authorised, the response contains the file.


Permissions

To download a private file, all of the following must be true. Otherwise the request returns 401 Unauthorised.

  • The correct tenantSubDomainName is supplied in the URL.
  • The request is signed in (authenticated).
  • The signed-in account is either the user who owns the file, or an administrator who has access to the file (see Admin User Roles for more details).


Examples

Example URL

https://{platform API url}/api/file/download/file/128c27e7-3397-419d-acd1-4930c5505ce6/mytenant/false/gallery/false

C# Example

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://{platform API url}/api/file/download/file/{fileGuid}/{tenantSubDomainName}/false/gallery/false");
request.Headers.Add("Authorization", "Bearer {access token}");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var bytes = await response.Content.ReadAsByteArrayAsync();

cURL Example

curl --location 'https://{platform API url}/api/file/download/file/{fileGuid}/{tenantSubDomainName}/false/gallery/false' \
--header 'Authorization: Bearer {access token}' \
--output {fileName}.{fileExtension}