Box Developerドキュメント
最新バージョン

Create a Box Doc Gen template

post
https://api.box.com/2.0
/docgen_templates

Marks a file as a Box Doc Gen template.

リクエスト

bearer [ACCESS_TOKEN]
application/json

リクエストヘッダー

stringヘッダー内必須

Version header

次の値に固定: 2025.0

リクエスト本文

object本文内

Marks the file as a Box Doc Gen template to generate the document from.

string本文内必須
"42037322"

ID of the object

string本文内必須
"file"

file

次の値に固定: file

レスポンス

The file which has now been marked as a Box Doc Gen template.

クライアントエラーが原因で、サーバーはリクエストを処理できないか、処理しません。

The client does not have access rights to the content or resource requested.

The user has sent too many requests in a given amount of time.

An unexpected condition was encountered on the server.

post
Create a Box Doc Gen template
このドキュメント内で一部のAPIを試せるようになりました。
ログイン

リクエストの例

cURL
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"
        }
}'
TypeScript Gen
await client.docgenTemplate.createDocgenTemplateV2025R0({
  file: new FileReferenceV2025R0({ id: uploadedFile.id }),
} satisfies DocGenTemplateCreateRequestV2025R0);
Python Gen
client.docgen_template.create_docgen_template_v2025_r0(
    FileReferenceV2025R0(id=uploaded_file.id)
)
.NET Gen
await client.DocgenTemplate.CreateDocgenTemplateV2025R0Async(requestBody: new DocGenTemplateCreateRequestV2025R0(file: new FileReferenceV2025R0(id: uploadedFile.Id)));

レスポンスの例

{
  "file": {
    "id": "42037322",
    "type": "file"
  }
}