Template API

Compare proposed changes with the published version

The template must have a published version. The endpoint renders the published version as before and the supplied template payload as after for visual comparison without saving the changes. The conversion cost is calculated separately for each successfully rendered side.

post/v1/templates/{templateId}/diff

Request

  • Base URL: https://api.pdfbolt.com
  • URL: https://api.pdfbolt.com/v1/templates/{templateId}/diff
  • Auth: API key in header PERSONAL-ACCESS-TOKEN

Path parameters

templateIdstring uuid required
Example:00000000-0000-0000-0000-000000000000

UUID of a PDFBolt template.

Query parameters

responseFormat'json' | 'url'

Response format. Defaults to url, which returns temporary documentUrl and expiresAt values. Use json to return each rendered PDF as pdfBase64 instead. Both formats include documentSizeMb and error for each side and report the conversion cost in the x-pdfbolt-conversion-cost response header.

Request body

templateEngine'HANDLEBARS'

Template engine used to evaluate template content.

contentstring byte required

Base64-encoded complete UTF-8 HTML document to render, with optional Handlebars placeholders.

sampleDataobject required

JSON object used to populate the supplied template.

Response

Comparison completed. Rendering failures are returned in before.error or after.error while the response remains HTTP 200.

OR

Changes

No recorded changes to this operation across all 1 revision of this API.