Download File - Download file v1
OVERVIEW
API methods to download a file from Collaborate. (File not the metadata; metadata should be downloaded using the “get file info” API.)
This method supports downloading a specific version of a file.
Admin users can download the original contents of the file by passing downloadoriginal=true as a query parameter.
Assumption
- original=true parameter is only applicable for users, who have rights to download original version from Collaborate web based interface.
- If workflow is enabled for the site and the document is in pending state, this method call will download the file for the file owner & content admin.
Request
GET /api/1/files/{fileid}/content
Parameters
Parameter Name | Value | Description |
---|---|---|
fileid | Int | The ID for the file in question |
Query Parameters
Parameter Name | Value | Description |
---|---|---|
version | Int | Specific version of the file which is to be downloaded |
original | True/false (default) |
Use this parameter to download the original format of the document.
If both version parameter and original = true is set then the original format of the file will be returned for the specified version of the document. |
Request body
No request body is required for this call
Response
If successful, this method returns a 200 OK response. If DRM is enabled, the user can request the original file if they have access to it. If site password, IP address access or terms and conditions are enabled, No API requests will be successful.
Error object is returned in case of an error.
I am afraid if DRM is enabled then there is no current solution for the API interaction.
Imran Aziz Thanks, you're right. DRM is enabled on the site that doesn't work and it's not in the other. I'll look into it.
Egbert van der Wal Please check if there is DRM enabled on the site or it has other security permissions enabled like terms and conditions, 2FA , site password, as that will prevent the API to download the files. I am afraid we do not have API's that can bypass such site security settings, you can, however, raise a support request and the support can switch a global setting to allow API interaction for sites who have the site security settings enabled.
Imran Aziz I am able to download the file using the web interface. I tried different files on the same site and they all give a 403. I also tried a file on a different site and that one does download correctly. So it does seem to be a permission error, even though the reported permissions on the file do not indicate that.
Egbert van der Wal have your tried the API call with other files / sites? There can be multiple reasons for the "Access denied" error. Are you able to download the specific file using the Web interface?
Imran Aziz what could cause a 403 "Access denied" to occur in response to this call? The /api/1/{fileid}/ call returns a permissions object with view, edit and delete set to 1, so the permissions seem to be adequate, but for some reason the download is still failing.
Milan Babel I have just edited the documentation to clarify the condition under which the "original" parameter works, if you are an admin user then you can use "downloadoriginal" parameter.
using parameter original leads to 401, using above mentioned downloadoriginal works
Comments
8 Comments