Box Doc Genテンプレート
Box Doc Genテンプレート
Box Doc Gen APIを使用すると、Box Doc Genテンプレートに関連した情報を取得できます。
前提条件
Box Doc Gen APIの使用を開始する前に、Box Doc Genの使い方ガイドに記載されている手順に従って、PlatformアプリとBox Doc Genテンプレートを作成してください。
Box Doc Genテンプレートのリストを取得
作成されたすべてのBox Doc Genテンプレートのリストを取得するには、GET /2.0/docgen_templatesエンドポイントを使用します。追加のパラメータを指定する必要はありません。
curl -L 'https://api.box.com/2.0/docgen_templates' \
-H 'box-version: 2025.0' \
-H 'Authorization: Bearer <ACCESS_TOKEN>'await client.docgenTemplate.getDocgenTemplatesV2025R0();client.docgen_template.get_docgen_templates_v2025_r0()await client.DocgenTemplate.GetDocgenTemplatesV2025R0Async();try await client.docgenTemplate.getDocgenTemplatesV2025R0()client.getDocgenTemplate().getDocgenTemplatesV2025R0()await client.DocgenTemplate.GetDocgenTemplatesV2025R0Async();await client.docgenTemplate.getDocgenTemplatesV2025R0();レスポンスには、すでに作成済みのBox Doc Genテンプレートを列挙するentries配列が含まれます。
IDを指定してBox Doc Genテンプレートを取得
特定のBox Doc Genテンプレートを取得するには、GET /2.0/docgen_templates_idエンドポイントを使用し、template_idを指定します。
curl -L 'https://api.box.com/2.0/docgen_templates/12345678' \
-H 'box-version: 2025.0' \
-H 'Authorization: Bearer <ACCESS_TOKEN>'await client.docgenTemplate.getDocgenTemplateByIdV2025R0(
createdDocgenTemplate.file!.id,
);client.docgen_template.get_docgen_template_by_id_v2025_r0(
created_docgen_template.file.id
)await client.DocgenTemplate.GetDocgenTemplateByIdV2025R0Async(templateId: NullableUtils.Unwrap(createdDocgenTemplate.File).Id);try await client.docgenTemplate.getDocgenTemplateByIdV2025R0(templateId: createdDocgenTemplate.file!.id)client.getDocgenTemplate().getDocgenTemplateByIdV2025R0(createdDocgenTemplate.getFile().getId())await client.DocgenTemplate.GetDocgenTemplateByIdV2025R0Async(templateId: NullableUtils.Unwrap(createdDocgenTemplate.File).Id);await client.docgenTemplate.getDocgenTemplateByIdV2025R0(
createdDocgenTemplate.file!.id,
);レスポンスには、Box Doc Genテンプレートとして使用されたファイルの詳細が含まれます。
テンプレートのすべてのドキュメント生成ジョブのリストを取得
作成済みのすべてのBox Doc Genテンプレートのリストを取得するには、GET /2.0/docgen_template_jobs_idエンドポイントを使用し、template_idを指定します。
curl -L 'https://api.box.com/2.0/docgen_template_jobs/12345678' \
-H 'box-version: 2025.0' \
-H 'Authorization: Bearer <ACCESS_TOKEN>'await client.docgenTemplate.getDocgenTemplateJobByIdV2025R0(
fetchedDocgenTemplate.file!.id,
);client.docgen_template.get_docgen_template_job_by_id_v2025_r0(
fetched_docgen_template.file.id
)await client.DocgenTemplate.GetDocgenTemplateJobByIdV2025R0Async(templateId: NullableUtils.Unwrap(fetchedDocgenTemplate.File).Id);try await client.docgenTemplate.getDocgenTemplateJobByIdV2025R0(templateId: fetchedDocgenTemplate.file!.id)client.getDocgenTemplate().getDocgenTemplateJobByIdV2025R0(fetchedDocgenTemplate.getFile().getId())await client.DocgenTemplate.GetDocgenTemplateJobByIdV2025R0Async(templateId: NullableUtils.Unwrap(fetchedDocgenTemplate.File).Id);await client.docgenTemplate.getDocgenTemplateJobByIdV2025R0(
fetchedDocgenTemplate.file!.id,
);レスポンスには、ドキュメントを生成するために実行されたBox Doc Genジョブのリストが含まれます。