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

ファイル情報の取得 (Get File Information)

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

ドキュメントの完全なメタデータを、リンクされたすべてのファイルとあわせて取得します。オプションで、バージョンのアーカイブ履歴やフォルダの割り当てを含めることもできます。

リクエスト​

パスパラメータ​

パラメータ型説明
doc_idintegerドキュメントの一意識別子です。

クエリパラメータ​

パラメータ型デフォルト説明
includestring—カンマ区切りの追加項目:versions、folders

レスポンス​

200 OK

ドキュメントオブジェクト​

フィールド型説明
idintegerドキュメントの一意識別子です。
descriptionstringドキュメントのタイトルです。ダウンロード時の既定のファイル名としても使用されます。
doc_numberstring自動生成されたドキュメント番号です。
doc_typestringドキュメントの種類です(例:"Invoice"、"Report")。
doc_statusstring現在のステータスです(例:"Draft"、"Final")。
reference_numberstring参照識別子です — 外部または内部で生成されます。
datedatetimeドキュメントの業務上の日付です(ISO 8601)。
from_entitystring送信元組織の名前です。
to_entitystring受信先組織の名前です。
entry_personstring作成者のユーザー名です。
entry_datedatetimeドキュメントが作成された日時です。
rev_numberstring改訂識別子です(例:"A"、"01")。
main_doc_numberstringこのドキュメントが添付されている親ドキュメントのドキュメント番号です。
privilegedbooleanメタデータフラグです。情報提供のみを目的としています。
islockedbooleanロックされている場合は true です。この場合は変更できません。
account_numberstringアカウントまたはプロジェクト番号です。

リンクされたファイル(linked_files)​

ドキュメントに添付されたファイルで、新しい順に並びます。

フィールド型説明
ownidintegerファイルバージョン ID です。ダウンロードの linked_file_id として使用します。
image_namestring正式なストレージ上のファイル名です。
image_typestringMIME タイプです(例:"application/pdf")。
image_sizeintegerファイルサイズ(バイト)です。
page_countintegerページ数です(PDF のみ)。
orignamestringアップロード時の元のファイル名です。
filehashstring整合性検証用の SHA-256 ハッシュです。
lastmodifieddatetime最終更新日時です。

バージョン履歴(version_history)​

?include=versions を指定した場合のみ含まれます。

フィールド型説明
own_idintegerアーカイブレコード ID です。
image_namestringアーカイブされたファイル名です。
orig_namestring元のファイル名です。
typestringアーカイブされた理由です(例:"replaced in portal")。
entry_datedatetimeアーカイブされた日時です。
file_hashstringSHA-256 ハッシュです。

フォルダ(folders)​

?include=folders を指定した場合のみ含まれます。

フィールド型説明
folder_idintegerフォルダ ID です。
namestringフォルダの表示名です。
full_pathstringフルパスです(例:"Finance->Invoices")。
parent_idinteger親フォルダの ID です。0 はルートを表します。

エラー​

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

cURL​

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

{
"id": 1542,
"description": "January Invoice",
"doc_number": "INV-00042",
"doc_type": "Invoice",
"doc_status": "Final",
"reference_number": "INV-2025-001",
"date": "2025-01-15T00:00:00",
"from_entity": "Acme Corp",
"to_entity": "Widget Inc",
"entry_person": "jdoe",
"entry_date": "2025-01-15T10:30:00",
"rev_number": "A",
"privileged": false,
"islocked": false,
"account_number": "PROJ-2025",
"linked_files": [
{
"ownid": 3801,
"id": 1542,
"image_name": "1542_a7f2c.pdf",
"image_type": "application/pdf",
"image_size": 245760,
"page_count": 12,
"origname": "invoice-january.pdf",
"filehash": "e3b0c44298fc1c14...",
"lastmodified": "2025-01-15T10:30:00",
"lastmodifieduser": 3,
"pdf_image_name": null
}
],
"version_history": [
{
"own_id": 201,
"image_name": "1542_old_abc.pdf",
"orig_name": "invoice-draft.pdf",
"description": "Replaced in Portal",
"type": "replaced in portal",
"entry_date": "2025-01-14T09:00:00",
"entry_person": 3,
"image_size": 230400,
"file_hash": "a1b2c3d4e5f6..."
}
],
"folders": [
{
"folder_id": 42,
"code": "f-abc-123",
"name": "Invoices",
"full_path": "Finance->Invoices",
"parent_id": 10
}
]
}
{"detail": "Invalid or expired token"}
{"detail": "Document not found or access denied"}