Downloading a File
You can use the download call to download a file.
Sample URL
https://hostname:port/context/rest/v2/documents/download/?BrowserXfer=Y&TransferDirection=download&id=<documentID>
Parameters
Parameter | Description |
---|---|
id | The ID of the document.
This parameter is required if the path parameter is not present. |
path | The fully qualified File Share path name.
This parameter is required if the id parameter is not present; otherwise, it is ignored. |
BrowserXfer | Required.
The value must be Y. |
TransferDirection | Required.
The value must be download. |
Response
If the call is executed successfully, the HTTP status code 200 and the following additional HTTP headers are returned:
Content-Disposition:attachment;filename="<fileName>"
Content-Length:<integer to indicates the file size>
Content-Type:application/octet-stream;charset=UTF-8.
If an error occurs and the request header accept contains application/json, response will be a JSON object:
{"message":"Failure message"}
If request header accept does not contain application/json, the response is a HTML page with error message.