Download File
GET/apiv2/pub/documents/{doc_id}/downloaddocuments_read
Streams the binary content of a document file. Returns the latest file by default, or a specific version via linked_file_id.
Request
Path parameters
| Parameter | Type | Description |
|---|---|---|
doc_id | integer | Document ID. |
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
linked_file_id | integer | — | Specific file version ownid. Omit for latest. |
Response
200 OK — Binary file stream
| Header | Description |
|---|---|
Content-Disposition | attachment; filename="invoice.pdf" |
Content-Length | File size in bytes |
Content-Type | application/octet-stream |
Errors
| Status | Reason |
|---|---|
| 401 | Invalid or expired token |
| 403 | No permission to access this document |
| 404 | Document or file not found |
cURL
curl -O -J "https://portal.docwize.com/apiv2/pub/documents/1542/download" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
HTTP/1.1 200 OK
Content-Disposition: attachment; filename="invoice.pdf"
Content-Length: 245760
Content-Type: application/octet-stream
[binary file data]