Get Document by File ID
GET /ws/rest/service/v1/dm/file/download/<file_id>
Purpose
Downloads the contents of a single document based on file ID.
Prerequisites
Ensure the following:
- Configure the Document Manager in the shell where the document is to be retrieved.
- You must have Get permissions to use this REST service of Document Manager.
- Create or upload a document/file to download using the file_id.
Path Parameter
Specify the following path parameter:
| Request Parameter | Required? | Data Type | Description |
|---|---|---|---|
| file_id | Yes | Integer | The file id of the document you want. Use the Get Folders or Documents Metadata by Path REST service to get the file_id value for the document. as a tiff file. |
Response Format
A document file stream object or a failed response displays with a status code in the following format:
{
"data": [],
"message": [],
"status": <REST status code value>
}
Sample Success Response
HTTP/1.1 200 OK
Date: Thu, 01 Sep 2016 15:35:07 GMT
Transfer-Encoding: chunked
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=Autovue_reply.txt
<< Contents of the file being downloaded >>
Sample Failed Response
A failed response displays with a status code in the following format:
{
"data":[ ],
"message": [ "File does not exist."],
"status":1069
}
Supported Validation Messages and Status Codes
The following validation messages and status codes display in the response when incorrect values are provided in the request.
| Field Name | Use-case Scenario | Status Code | Error Message |
|---|---|---|---|
| file_id | file_id is invalid. | 1069 | File does not exist. |