Template management

Template management

Endpoint: Retrieve all Templates

Here's an example of how you can use a curl API call to get a list of available templates.

curl -X GET \
  -H "Authorization: Bearer <your_api_key>" \
  https://api.pdfdesignapi.com/api/v1/templates

Replace <your_api_key> with your actual API key

Response

The success response will be of the following json format:

{
  "templates": [
    {
      "uuid": "00000000-0000-0000-0000-000000000001",
      "name": "Invoice",
      "example_data": {
        "date": "2023-01-01",
        "customer": {
          "name": "John Doe",
          "email": "johndoe@example.com",
          "address": "123 Main Street, Anytown, The Netherlands"
        },
        "items": [
          {
            "description": "Item A",
            "quantity": 2,
            "price": 10.99
          },
          {
            "description": "Item B",
            "quantity": 3,
            "price": 5.99
          }
        ]
      },
    },
    {
      "uuid": "00000000-0000-0000-0000-000000000002",
      "name": "Generic letter",
      "example_data": {
        "date": "2023-06-30",
        "sender": {
          "name": "Jeroen",
          "address": "123 Main Street, Anytown, The Netherlands",
          "email": "jeroen@pdfdesignapi.com",
          "phone": "123-456-7890"
        },
        "recipient": {
          "name": "You",
          "address": "456 Elm Street, Anycity, The Netherlands"
        },
        "subject": "Greetings",
        "body": "Dear You,\n\nSending warm greetings your way! I hope this letter finds you in good health and high spirits. It would be wonderful to catch up and hear how you've been. If life permits, let's reconnect soon. Wishing you all the best!\n\nWarm regards,\nJeroen"
      }
    }
  ]
}

You can use these templates to generate a pdf. For this, see the chapter "Api Endpoints and Operations"

Previous
Endpoints