Skip to main content
POST
Preview a template

Autorizações

Authorization
string
header
obrigatório

JWT bearer token issued by the identity provider.

Corpo

application/json

Template markup and the sample data to render it against.

content
string
obrigatório

Raw pongo2 template markup to render. At most 512 KiB, measured on the decoded bytes.

Maximum string length: 524288
Exemplo:

"Total: {{ ledger.accounts.0.balance }}"

outputFormat
string

One of Html, Csv, Txt, Xml or Pdf, matched case-insensitively. Decides the response content type only; defaults to Html when omitted or empty.

Pattern: ^([Hh][Tt][Mm][Ll]|[Cc][Ss][Vv]|[Tt][Xx][Tt]|[Xx][Mm][Ll]|[Pp][Dd][Ff])?$
Exemplo:

"Html"

sampleData
object

Render context shaped as data source, then table, then rows. At most 1 MiB, measured on the raw JSON bytes sent for this member.

Resposta

OK

contentType
string
obrigatório

Content type the rendered output should be displayed as.

Exemplo:

"text/html"

durationMs
integer<int64>
obrigatório

How long the preview took, in milliseconds.

Exemplo:

12

rendered
string
obrigatório

Rendered output. For a Pdf template this is the HTML stage that would feed the PDF engine.

Exemplo:

"Total: 1500.00"

warnings
string[]
obrigatório

Non-fatal render notes, such as output having been truncated.