Skip to main content
POST
Preview a template

Autorizaciones

Authorization
string
header
requerido

JWT bearer token issued by the identity provider.

Cuerpo

application/json

Template markup and the sample data to render it against.

content
string
requerido

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

Maximum string length: 524288
Ejemplo:

"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])?$
Ejemplo:

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

Respuesta

OK

contentType
string
requerido

Content type the rendered output should be displayed as.

Ejemplo:

"text/html"

durationMs
integer<int64>
requerido

How long the preview took, in milliseconds.

Ejemplo:

12

rendered
string
requerido

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

Ejemplo:

"Total: 1500.00"

warnings
string[]
requerido

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