Mark file as Box Doc Gen template
Mark file as Box Doc Gen template
You can mark an existing document as a Box Doc Gen template and use it to generate documents.
Before you start
Before you start using Box Doc Gen API, follow the steps listed in the get started with Box Doc Gen guide to create a custom app and a Box Doc Gen template.
Send a request
To send a request containing your question,
use the POST /2.0/docgen_templates
endpoint and
provide the mandatory parameters.
Parameters
To make a call you need to pass the following parameters. Mandatory parameters are in bold.
Parameter | Description | Example |
---|---|---|
file.id | ID of the file to be marked as the Box Doc Gen template. | 12345678 |
file.type | The type of provided input. The value is always file . | file |
Use cases
Mark a file as Box Doc Gen template
The following sample show you how to mark a file to ensure it is recognized as a Box Doc Gen template.
curl -L 'https://api.box.com/2.0/docgen_templates' \
-H 'box-version: 2025.0' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-D '{
"file": {
"id": "12345678",
"type": "file"
}
}'
Remove Box Doc Gen template marking from a file
To make sure a file is no longer marked as a Box Doc Gen template,
use the DELETE 2.0/docgen_templates/:template_id
request.
curl -L -X DELETE 'https://api.box.com/2.0/docgen_templates/12345678' \
-H 'box-version: 2025.0' \
-H 'Authorization: Bearer <ACCESS_TOKEN>'