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

{
  "id": "",
  "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"

legacy
boolean

Legacy flag. To be used only on systems with activated legacy module. Default: false

Available options: truefalse

Example: false

chartIdentifiers
string[]

Identifier list of charts, used in current template

Example: ["consumption","balance"]

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

format
enum<string>

Target file format. Default: pdf

Available options: pdfdocodtrtfhtmltxt

Example: "pdf"

data
object

Data to be used in rendering process

Example: {"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"}]}