> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Box Doc Genテンプレート

export const MultiRelatedLinks = ({sections = []}) => {
  if (!sections || sections.length === 0) {
    return null;
  }
  return <div className="space-y-8">
      {sections.map((section, index) => <RelatedLinks key={index} title={section.title} items={section.items} />)}
    </div>;
};

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

export const Link = ({href, children, className, ...props}) => {
  const localizedHref = localizeLink(href);
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

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

## 前提条件

Box Doc Gen APIの使用を開始する前に、<Link href="/guides/docgen/docgen-getting-started">Box Doc Genの使い方</Link>ガイドに記載されている手順に従って、PlatformアプリとBox Doc Genテンプレートを作成してください。

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

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

<CodeGroup>
  ```sh cURL theme={null}
  curl -L 'https://api.box.com/2.0/docgen_templates' \
       -H 'box-version: 2025.0' \
       -H 'Authorization: Bearer <ACCESS_TOKEN>'
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.docgenTemplate.getDocgenTemplatesV2025R0();
  ```

  ```python Python v10 theme={null}
  client.docgen_template.get_docgen_templates_v2025_r0()
  ```

  ```cs .NET v10 theme={null}
  await client.DocgenTemplate.GetDocgenTemplatesV2025R0Async();
  ```

  ```swift Swift v10 theme={null}
  try await client.docgenTemplate.getDocgenTemplatesV2025R0()
  ```

  ```java Java v10 theme={null}
  client.getDocgenTemplate().getDocgenTemplatesV2025R0()
  ```
</CodeGroup>

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

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

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

<CodeGroup>
  ```sh cURL theme={null}
  curl -L 'https://api.box.com/2.0/docgen_templates/12345678' \
       -H 'box-version: 2025.0' \
       -H 'Authorization: Bearer <ACCESS_TOKEN>'
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.docgenTemplate.getDocgenTemplateByIdV2025R0(
    createdDocgenTemplate.file!.id,
  );
  ```

  ```python Python v10 theme={null}
  client.docgen_template.get_docgen_template_by_id_v2025_r0(
      created_docgen_template.file.id
  )
  ```

  ```cs .NET v10 theme={null}
  await client.DocgenTemplate.GetDocgenTemplateByIdV2025R0Async(templateId: NullableUtils.Unwrap(createdDocgenTemplate.File).Id);
  ```

  ```swift Swift v10 theme={null}
  try await client.docgenTemplate.getDocgenTemplateByIdV2025R0(templateId: createdDocgenTemplate.file!.id)
  ```

  ```java Java v10 theme={null}
  client.getDocgenTemplate().getDocgenTemplateByIdV2025R0(createdDocgenTemplate.getFile().getId())
  ```
</CodeGroup>

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

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

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

<CodeGroup>
  ```sh cURL theme={null}
  curl -L 'https://api.box.com/2.0/docgen_template_jobs/12345678' \
       -H 'box-version: 2025.0' \
       -H 'Authorization: Bearer <ACCESS_TOKEN>'
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.docgenTemplate.getDocgenTemplateJobByIdV2025R0(
    fetchedDocgenTemplate.file!.id,
  );
  ```

  ```python Python v10 theme={null}
  client.docgen_template.get_docgen_template_job_by_id_v2025_r0(
      fetched_docgen_template.file.id
  )
  ```

  ```cs .NET v10 theme={null}
  await client.DocgenTemplate.GetDocgenTemplateJobByIdV2025R0Async(templateId: NullableUtils.Unwrap(fetchedDocgenTemplate.File).Id);
  ```

  ```swift Swift v10 theme={null}
  try await client.docgenTemplate.getDocgenTemplateJobByIdV2025R0(templateId: fetchedDocgenTemplate.file!.id)
  ```

  ```java Java v10 theme={null}
  client.getDocgenTemplate().getDocgenTemplateJobByIdV2025R0(fetchedDocgenTemplate.getFile().getId())
  ```
</CodeGroup>

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

<RelatedLinks
  title="関連するガイド"
  items={[
{ label: translate("Get started with Box Doc Gen"), href: "/guides/docgen/docgen-getting-started", badge: "GUIDE" },
{ label: translate("Generate documents"), href: "/guides/docgen/generate-document", badge: "GUIDE" }
]}
/>
