Box Developerドキュメント

Box Doc Genテンプレート

ガイド Box Doc Gen Box Doc Genテンプレート

Box Doc Genテンプレート

Box Doc Gen APIを使用すると、Box Doc Genテンプレートに関連した情報を取得できます。

前提条件

Before you start using Box Doc Gen API, follow the steps listed in the get started with Box Doc Gen guide to create a platform app and a Box Doc Gen template.

Box Doc Genテンプレートのリストを取得

作成されたすべてのBox Doc Genテンプレートのリストを取得するには、GET /2.0/docgen_templatesエンドポイントを使用します。追加のパラメータを指定する必要はありません。

cURL
curl -L 'https://api.box.com/2.0/docgen_templates' \
     -H 'box-version: 2025.0' \
     -H 'Authorization: Bearer <ACCESS_TOKEN>'
TypeScript Gen
await client.docgenTemplate.getDocgenTemplatesV2025R0();
Python Gen
client.docgen_template.get_docgen_templates_v2025_r0()
.NET Gen
await client.DocgenTemplate.GetDocgenTemplatesV2025R0Async();

レスポンスには、すでに作成済みのBox Doc Genテンプレートを列挙するentries配列が含まれます。

IDを指定してBox Doc Genテンプレートを取得

特定のBox Doc Genテンプレートを取得するには、GET /2.0/docgen_templates_idエンドポイントを使用し、template_idを指定します。

cURL
curl -L 'https://api.box.com/2.0/docgen_templates/12345678' \
     -H 'box-version: 2025.0' \
     -H 'Authorization: Bearer <ACCESS_TOKEN>'
TypeScript Gen
await client.docgenTemplate.getDocgenTemplateByIdV2025R0(
  createdDocgenTemplate.file!.id,
);
Python Gen
client.docgen_template.get_docgen_template_by_id_v2025_r0(
    created_docgen_template.file.id
)
.NET Gen
await client.DocgenTemplate.GetDocgenTemplateByIdV2025R0Async(templateId: NullableUtils.Unwrap(createdDocgenTemplate.File).Id);

レスポンスには、Box Doc Genテンプレートとして使用されたファイルの詳細が含まれます。

テンプレートのすべてのドキュメント生成ジョブのリストを取得

作成済みのすべてのBox Doc Genテンプレートのリストを取得するには、GET /2.0/docgen_template_jobs_idエンドポイントを使用し、template_idを指定します。

cURL
curl -L 'https://api.box.com/2.0/docgen_template_jobs/12345678' \
     -H 'box-version: 2025.0' \
     -H 'Authorization: Bearer <ACCESS_TOKEN>'
TypeScript Gen
await client.docgenTemplate.getDocgenTemplateJobByIdV2025R0(
  fetchedDocgenTemplate.file!.id,
);
Python Gen
client.docgen_template.get_docgen_template_job_by_id_v2025_r0(
    fetched_docgen_template.file.id
)
.NET Gen
await client.DocgenTemplate.GetDocgenTemplateJobByIdV2025R0Async(templateId: NullableUtils.Unwrap(fetchedDocgenTemplate.File).Id);

レスポンスには、ドキュメントを生成するために実行されたBox Doc Genジョブのリストが含まれます。