Tools

Template draft testing

Endpoint can be used to test template drafts before uploading them into system

POST/api/test-template-draft

Authorizations

X-AUTH-TOKEN
stringheaderrequired

Value for the X-AUTH-TOKEN header parameter.

Request Body

application/json
required

The new TestTemplateDraft resource

{
  "description": "Invoice Nbr. <<invoice.number>> | Invoice Nbr. 123",
  "fileName": "invoice_nbr_<<invoice.number>> | invoice_nbr_123",
  "customId": "<<invoice.number>> | 123",
  "legacy": false,
  "chartIdentifiers": [
    "consumption",
    "balance"
  ],
  "file": "data:application/docx;base64,xxx... | data:application/pdf;base64,xxx...",
  "format": "pdf",
  "data": {
    "contract": {
      "email": "john.doe@output.rocks"
    },
    "invoice": {
      "number": "123",
      "date": "12 March 2022"
    },
    "items": [
      {
        "qty": "3",
        "ItemName": "ACP101 Accounting Package",
        "amt": "1350.00"
      },
      {
        "qty": "4.5",
        "ItemName": "ACP101S Standard Support",
        "amt": "450.00"
      },
      {
        "qty": "10",
        "ItemName": "ACP101T Online Training",
        "amt": "1200.00"
      }
    ]
  }
}

Response

201application/json

TestTemplateDraft resource created

id
string

Unique test-template-draft request identifier.

Example: ""

description
string

Input: description with optional placeholders<br>Output: generated description

Example: "Invoice Nbr. <<invoice.number>> | Invoice Nbr. 123"

fileName
string

Input: target file name with optional placeholders<br>Output: generated target file name

Example: "invoice_nbr_<<invoice.number>> | invoice_nbr_123"

customId
string

Input: custom ID with optional placeholders<br>Output: generated custom ID

Example: "<<invoice.number>> | 123"

file
string<binary>required

Input: base64 encoded template (.dox) file<br>Output: base64 encoded generated file

Example: "data:application/docx;base64,xxx... | data:application/pdf;base64,xxx..."