Generating PDFs
Export SDK provides several ways to generate PDFs. You can use the REST API, Javascript SDK, or Zapier integration. Whatever path you choose, there are three pieces of information you'll need from your dashboard.
- API Key
- Template ID
- Template JSON tree
#
API KeyAPI keys are located under the 'Settings' section of the dashboard. You can create as many keys as you need and delete them when necessary.
#
Template IDTemplate IDs are located next to the template name in the 'Templates' section of the dashboard. Click the copy button next to the template ID to add it to your clipboard.
#
JSON TreeThe JSON tree for a given template can be found within the 'Preview' window. To get there, click on the name of the template within the 'Templates' section of the dashboard and then click the 'Preview' button in the top right.
The expected JSON for the template will be located in the left pane of the 'Preview' window.
Now that we know where to get all of the information needed, let's take a look at a simple API request.
#
Example API requestWith our API key, template ID, and JSON at the ready, here is how we could construct a POST request and receive a PDF in the response.
{ "request": { "method": "POST", "header": [ { "key": "X-API-KEY", "value": "{{apiKey}}", "type": "text" } ], "body": { "templateId": "{{templateId}}", "data": { "Company": "Bluth Banana Stand", "date": "10/21/2021", "email": "[email protected]", "invoiceNumber": "2003", "phoneNumber": "555-555-5555", "total": "5.99", "order": [ { "description": "Frozen Banana", "price": "5.99", "quantity": "1" } ] } }, "url": "https://api.exportsdk.com/v1/pdf", },}
That's it! Pretty simple, right? If you run into any issues or have any questions, hit the chat button or send an email to [email protected].