Skip to main content

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

ParameterTypeDescription
doc_idintegerDocument ID.

Query parameters

ParameterTypeDefaultDescription
linked_file_idintegerSpecific file version ownid. Omit for latest.

Response

200 OK — Binary file stream

HeaderDescription
Content-Dispositionattachment; filename="invoice.pdf"
Content-LengthFile size in bytes
Content-Typeapplication/octet-stream

Errors

StatusReason
401Invalid or expired token
403No permission to access this document
404Document 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]
{"detail": "Access denied to document"}
{"detail": "No file found for this document"}