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

新しいバージョンのアップロード (Upload New Version)

POST/apiv2/pub/documents/{doc_id}/versionsdocuments_write

新しいファイルバージョンをアップロードします。現在有効なファイルは、種別 "replaced in portal" として自動的にアーカイブされます。

リクエスト​

Content-Type: multipart/form-data

パスパラメータ​

パラメータ型説明
doc_idintegerバージョンを追加するドキュメントの ID です。

フォームフィールド​

フィールド型必須説明
filebinary必須新しいファイルバージョンです。

レスポンス​

200 OK
フィールド型説明
doc_idintegerドキュメント ID です。
linked_file_idinteger新しいファイルレコードの ID です(現在の有効なバージョンとなります)。
image_namestringシステムが生成したストレージ上のファイル名です。

エラー​

ステータス理由
401トークンが無効または期限切れです
404ドキュメントが見つからないか、アクセスが拒否されました
423ドキュメントがロックされています

cURL​

curl -X POST "https://portal.docwize.com/apiv2/pub/documents/1542/versions" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-F "file=@invoice_v2.pdf"

{
"doc_id": 1542,
"linked_file_id": 3802,
"image_name": "1542_b8e3d.pdf"
}
{"detail": "Document not found or access denied"}
{"detail": "Document is locked and cannot be updated"}