> ## 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.

# Get started with 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>;
};

To start generating documents with Box Doc Gen API you will need a platform application and a developer token to
authenticate your calls. You also need a Doc Gen template that will serve as an input source for your document.

## Enable Box Doc Gen

To use Box Doc Gen, make sure it is enabled by an
admin in the Admin Console.
If you are a Box Admin, you will find the necessary information in
[Enterprise Settings: Content & Sharing Tab][settings] documentation.

## Create and upload a Box Doc Gen template

To use Box Doc Gen API to generate documents, a Box Doc Gen template must already exist in Box. You have the following options to create a template:

* Install the [Box Doc Gen Template Creator add-in for Microsoft Word][template-addin].
* Create a Box Doc Gen template [using a JSON file][json-template] or manually create [template tags][template-tags].

## Create a platform application

First you need to create a platform application
you will use to make calls. To create
an application, follow the guide
on <Link href="/guides/applications/platform-apps/create">creating platform apps</Link>.

## Generate a developer token

You need a developer token
to authenticate your app when sending requests.

To generate a token:

1. Go to **Developer Console** > **My Platform Apps**.
2. Click the **Options menu** button (…) on the right.
3. Select **Generate Developer Token**. The token will be automatically generated and saved to clipboard.

<Frame>
  <img src="https://mintcdn.com/box/_tECS-SYBYV9K-kZ/images/guides/docgen/developer-token.png?fit=max&auto=format&n=_tECS-SYBYV9K-kZ&q=85&s=501d22896841a0400230126f4c8a7682" alt="generate token" width="1205" height="456" data-path="images/guides/docgen/developer-token.png" />
</Frame>

You can also open your app, go to
**Configuration** > **Developer Token**
and generate the token.

<Note>
  A developer token is only valid for one hour.
</Note>

For additional details, see <Link href="/guides/authentication/tokens/developer-tokens">developer token</Link>.
After you generate the token, you can use it in cURL
or other clients, such as <Link href="/guides/tooling/postman">Postman</Link>, to make
calls.

## Use webhooks

You can create webhooks to monitor Doc Gen events and automate your business process or workflow.

Follow the instructions for <Link href="/guides/webhooks/v2/create-v2/">adding webhooks</Link>. Your content type is your Doc Gen template file or folder.

The supported <Link href="/guides/webhooks/triggers">events</Link> are:

* `DOCGEN_DOCUMENT_GENERATION_STARTED`
* `DOCGEN_DOCUMENT_GENERATION_SUCCEEDED`
* `DOCGEN_DOCUMENT_GENERATION_FAILED`

<Frame>
  <img src="https://mintcdn.com/box/_tECS-SYBYV9K-kZ/images/guides/docgen/docgen-triggers.png?fit=max&auto=format&n=_tECS-SYBYV9K-kZ&q=85&s=c72ca45648da404e4477db8355612be6" alt="Doc Gen event triggers" width="535" height="322" data-path="images/guides/docgen/docgen-triggers.png" />
</Frame>

Information that is posted in a notification:

* Trigger name.
* Webhook trigger timestamp.
* Template file ID.
* Template file version ID.
* Template file name.
* Destination folder.
* Generated file ID (if the document generation process succeeds).
* Output type (DOCX or PDF).
* Reason (if the document generation process fails).

[settings]: https://support.box.com/hc/en-us/articles/4404822772755-Enterprise-Settings-Content-Sharing-Tab#h_01FYQGK5RW42T07GV985MQ9E9A

[template-addin]: https://support.box.com/hc/en-us/articles/36587535449747-Installing-Box-Doc-Gen-Add-in

[template-tags]: https://support.box.com/hc/en-us/articles/36151895655059-Creating-A-Box-Doc-Gen-Template-Manually

[json-template]: https://support.box.com/hc/en-us/articles/36148012877843-Creating-a-Box-Doc-Gen-Template-using-JSON-data

<RelatedLinks
  title="RELATED GUIDES"
  items={[
{ label: translate("Generate documents"), href: "/guides/docgen/generate-document", badge: "GUIDE" },
{ label: translate("Mark file as Box Doc Gen template"), href: "/guides/docgen/mark-template", badge: "GUIDE" },
{ label: translate("Box Doc Gen jobs"), href: "/guides/docgen/docgen-jobs", badge: "GUIDE" },
{ label: translate("Box Doc Gen templates"), href: "/guides/docgen/docgen-templates", badge: "GUIDE" }
]}
/>
