メインコンテンツまでスキップ

Get Download URL

GET/apiv3/pub/documents/{docID}/download-urldocuments_read

Generates a time-limited presigned S3 URL for downloading a document file. The URL can be used without any authentication headers.

Request

Path parameters

ParameterTypeDescription
docIDintegerDocument ID.

Query parameters

ParameterTypeDefaultDescription
linked_file_idintegerSpecific file version. Omit for latest.
pdfbooleanfalsetrue to get the PDF conversion URL.
expiryinteger3600URL lifetime in seconds.

Response

200 OK
FieldTypeDescription
urlstringPresigned S3 URL. Valid for the requested expiry duration. No auth headers needed to use it.

Errors

StatusReason
400Invalid docID
401Invalid or expired token
404Document not found or no file attached
500S3 presigning failed

cURL

curl -i -X GET "https://portal.docwize.com/apiv3/pub/documents/1542/download-url" \
-H "Authorization: Bearer <ACCESS_TOKEN>"

{
"url": "https://s3.amazonaws.com/bucket/company/1542_a7f2c.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&X-Amz-Signature=..."
}
{"detail": "Document not found or access denied"}
{"detail": "Could not generate download URL"}