ファイル情報の取得 (Get File Information)
GET/apiv2/pub/documents/{doc_id}documents_read
ドキュメントの完全なメタデータを、リンクされたすべてのファイルとあわせて取得します。オプションで、バージョンのアーカイブ履歴やフォルダの割り当てを含めることもできます。
リクエスト
パスパラメータ
| パラメータ | 型 | 説明 |
|---|---|---|
doc_id | integer | ドキュメントの一意識別子です。 |
クエリパラメータ
| パラメータ | 型 | デフォルト | 説明 |
|---|---|---|---|
include | string | — | カンマ区切りの追加項目:versions、folders |
レスポンス
200 OKドキュメントオブジェクト
| フィールド | 型 | 説明 |
|---|---|---|
id | integer | ドキュメントの一意識別子です。 |
description | string | ドキュメントのタイトルです。ダウンロード時の既定のファイル名としても使用されます。 |
doc_number | string | 自動生成されたドキュメント番号です。 |
doc_type | string | ドキュメントの種類です(例:"Invoice"、"Report")。 |
doc_status | string | 現在のステータスです(例:"Draft"、"Final")。 |
reference_number | string | 参照識別子です — 外部または内部で生成されます。 |
date | datetime | ドキュメントの業務上の日付です(ISO 8601)。 |
from_entity | string | 送信元組織の名前です。 |
to_entity | string | 受信先組織の名前です。 |
entry_person | string | 作成者のユーザー名です。 |
entry_date | datetime | ドキュメントが作成された日時です。 |
rev_number | string | 改訂識別子です(例:"A"、"01")。 |
main_doc_number | string | このドキュメントが添付されている親ドキュメントのドキュメント番号です。 |
privileged | boolean | メタデータフラグです。情報提供のみを目的としています。 |
islocked | boolean | ロックされている場合は true です。この場合は変更できません。 |
account_number | string | アカウントまたはプロジェクト番号です。 |
リンクされたファイル(linked_files)
ドキュメントに添付されたファイルで、新しい順に並びます。
| フィールド | 型 | 説明 |
|---|---|---|
ownid | integer | ファイルバージョン ID です。ダウンロードの linked_file_id として使用します。 |
image_name | string | 正式なストレージ上のファイル名です。 |
image_type | string | MIME タイプです(例:"application/pdf")。 |
image_size | integer | ファイルサイズ(バイト)です。 |
page_count | integer | ページ数です(PDF のみ)。 |
origname | string | アップロード時の元のファイル名です。 |
filehash | string | 整合性検証用の SHA-256 ハッシュです。 |
lastmodified | datetime | 最終更新日時です。 |
バージョン履歴(version_history)
?include=versions を指定した場合のみ含まれます。
| フィールド | 型 | 説明 |
|---|---|---|
own_id | integer | アーカイブレコード ID です。 |
image_name | string | アーカイブされたファイル名です。 |
orig_name | string | 元のファイル名です。 |
type | string | アーカイブされた理由です(例:"replaced in portal")。 |
entry_date | datetime | アーカイブされた日時です。 |
file_hash | string | SHA-256 ハッシュです。 |
フォルダ(folders)
?include=folders を指定した場合のみ含まれます。
| フィールド | 型 | 説明 |
|---|---|---|
folder_id | integer | フォルダ ID です。 |
name | string | フォルダの表示名です。 |
full_path | string | フルパスです(例:"Finance->Invoices")。 |
parent_id | integer | 親フォルダの 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
}
]
}