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

ファイルのダウンロード (Download File)

GET/apiv2/pub/documents/{doc_id}/downloaddocuments_read

ドキュメントファイルのバイナリコンテンツをストリーム配信します。既定では最新のファイルを返しますが、linked_file_id を指定して特定のバージョンを取得することもできます。

リクエスト​

パスパラメータ​

パラメータ型説明
doc_idintegerドキュメント ID です。

クエリパラメータ​

パラメータ型デフォルト説明
linked_file_idinteger—特定のファイルバージョンの ownid です。省略すると最新版になります。

レスポンス​

200 OK — バイナリファイルストリーム

ヘッダー説明
Content-Dispositionattachment; filename="invoice.pdf"
Content-Lengthファイルサイズ(バイト)
Content-Typeapplication/octet-stream

エラー​

ステータス理由
401トークンが無効または期限切れです
403このドキュメントにアクセスする権限がありません
404ドキュメントまたはファイルが見つかりません

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"}