eCom Learning Solutions / Developer toolsOpen source
Documentation/Getting started/Your first PDF
01 / QUICKSTART

Your first PDF

This example creates a complete document with caller supplied wording. Choose your preferred client. These examples use the address of the API you are viewing; change it to your deployment when integrating.

Bash / macOS / Linux
curl --fail-with-body \
  -X POST __API_ORIGIN__/api/v1/pdfs/custom-template \
  -H 'Content-Type: application/json' \
  --data '{"template":{"title":"{{data.title}}","pages":[{"layout":"flow","blocks":[{"type":"heading","text":"{{labels.heading}}"},{"type":"paragraph","text":"{{data.summary}}"}]}]},"labels":{"heading":"Overview"},"data":{"title":"Project brief","summary":"Made for your app."}}' \
  --output project-brief.pdf

On deployments that require a key, add -H 'X-Api-Key: YOUR_KEY' to cURL. Use a backend for calls from your platform so its API key stays private.