ファイルのダウンロード (Download File)
GET/apiv2/pub/documents/{doc_id}/downloaddocuments_read
ドキュメントファイルのバイナリコンテンツをストリーム配信します。既定では最新のファイルを返しますが、linked_file_id を指定して特定のバージョンを取得することもできます。
リクエスト
パスパラメータ
| パラメータ | 型 | 説明 |
|---|---|---|
doc_id | integer | ドキュメント ID です。 |
クエリパラメータ
| パラメータ | 型 | デフォルト | 説明 |
|---|---|---|---|
linked_file_id | integer | — | 特定のファイルバージョンの ownid です。省略すると最新版になります。 |
レスポンス
200 OK — バイナリファイルストリーム
| ヘッダー | 説明 |
|---|---|
Content-Disposition | attachment; filename="invoice.pdf" |
Content-Length | ファイルサイズ(バイト) |
Content-Type | application/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]