メインコンテンツへスキップ
POST
/
docgen_batches
cURL
curl -L 'https://api.box.com/2.0/docgen_batches' \
     -H 'box-version: 2025.0' \
     -H 'Authorization: Bearer <ACCESS_TOKEN>' \
     -D '{
        "file": {
            "id": "12345678",
            "type": "file"
        },
        "input_source": "api",
        "destination_folder": {
            "id": "12345678",
            "type": "folder"
        },
        "output_type": "docx",
        "document_generation_data": [
            {
                "generated_file_name": "Image test",
                "user_input": {
                    "order": {
                        "id": "12305",
                        "date": "18-08-2023",
                        "country": "US",
                        "expiryDate": "18-08-2024",
                        "currency": "$",
                        "amount": 5060.5,
                        "taxRate": 10,
                        "requester": "John",
                        "approver": "Smith",
                        "department": "Procurement",
                        "paymentTerms": "30 days",
                        "deliveryTerms": "30 days",
                        "deliveryDate": "18-09-2023",
                        "vendor": {
                            "company": "Example company",
                            "address": {
                                "street": "Example street",
                                "city": "Example city",
                                "zip": "EX-456"
                            }
                        },
                        "products": [
                            {
                                "id": 1,
                                "name": "A4 Papers",
                                "type": "non-fragile",
                                "quantity": 100,
                                "price": 29,
                                "amount": 2900
                            },
                            {
                                "id": 2,
                                "name": "Ink  Cartridge",
                                "type": "non-fragile",
                                "quantity": 40,
                                "price": 39,
                                "amount": 1560
                            },
                            {
                                "id": 3,
                                "name": "Adhesive tape",
                                "type": "non-fragile",
                                "quantity": 20,
                                "price": 30,
                                "amount": 600.5
                            }
                        ]
                    }
                }
            }
        ]`
{
  "id": "12345",
  "type": "docgen_batch"
}
Box SDKのバージョニング戦略について詳しく学ぶ。」

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

box-version
enum<string>
required

Version header.

利用可能なオプション:
2025.0

Body

application/json

Box Doc Genジョブのバッチリクエストを作成するためのスキーマ。

file
ファイルの参照 · object
required

ドキュメントの生成に使用されるBox Doc Genテンプレート。

input_source
string
required

入力のソース。この値は、APIベースのすべてのドキュメント生成リクエストでapiにする必要があります。

Example:

"api"

destination_folder
フォルダの参照 · object
required

生成されたファイルの保存先フォルダ。

output_type
string
required

出力ファイルの種類。

Example:

"docx"

document_generation_data
ドキュメント生成データ · object[]
required
file_version
ファイルバージョン (Base) · object

テンプレートのファイルバージョン。

Response

作成されたバッチID。

Box Doc GenバッチオブジェクトのBase版の表示。Box Doc Genのバッチには、1つ以上のBox Doc Genジョブが含まれています。

id
string
required

Box Doc Genのバッチを表す一意の識別子。

Example:

"12345"

type
enum<string>
required

値は常にdocgen_batchになります。

利用可能なオプション:
docgen_batch
Example:

"docgen_batch"