Community articleDownloading a file
Added by IBM contributorIBM on November 9, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Download a file from your library programmatically.
You can use one or more of these headers.

You can use one or more of these input parameters. Separate multiple parameters with an ampersand (&).




Binary content of the file. If active content filtering is enabled, and the file is an HTML file, it is filtered.

Note: This API can return a HTTP1.1/ 302 redirect if a different download domain is configured. When a different download domain is configured, the client needs be able to follow the redirect to eventually download the file.


This method does not require authentication to retrieve public resources. If authentication is provided, the user must have 'View' authority on the specified resource.

See Authenticating requests for information about how to authenticate the request.

To download using the public endpoint, use /basic/anonymous/api.

Method URI Description
GET /files/basic/anonymous/api/document/{document-id}/media Returns a public file from your library without authenticating the request.
GET /files/basic/api/myuserlibrary/document/{document-id}/media
Determine the resource address in either of the following ways:
Value of the href attribute of the <link rel="edit-media"> element in the file's Document Atom entries.
Construct the address using the following URL:/basic/api/myuserlibrary/document/{document-id}/ where {document-id} is the <td:uuid> or <td:label> element of the document entry.
Returns a file from your library. This request requires authentication.
Note: Use this URI to retrieve the binary data if you plan to update and return it using a PUT request.
Name Type Optional Description
string No {document-id} is the <td:uuid> or <td:label> element of the document entry.
Name Type Optional Description
boolean Yes Specifies whether the documents contents should be included inline in the content element. Options are true or false.
boolean Yes Specifies whether to log this file download. Options are true or false. By default, it does log the download.
Name Type Optional Description
string Yes Used to validate the local cache of the feed and entry documents retrieved previously. If the feed or entry has not been modified since the specified date, HTTP response code 304 (Not Modified) is returned.
string Yes Contains an ETag response header sent by the server in a previous request to the same URL. If the ETag is still valid for the specified resource, HTTP response code 304 (Not Modified) is returned.
Content Type: text/html
Code Description
Indicates that the file entry was successfully downloaded. If an error occurs, this header contains one of the error codes.
Not Found.
GET /files/basic/api/library/5d06ab0044ed8129bd5ebd4caeec5df1/document/5d06ab0044ed8129bd5ebd4caeec5df2/media HTTP/1.1 
User-Agent: Thingio/1.0

Response returned by the server
Binary file contents