PDF Generator API
Introduction PDF Generator API allows you easily generate transactional PDF documents and reduce the development and support costs by enabling your users to…
AI & machine learning#openapi#text
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
Introduction
PDF Generator API allows you easily generate transactional PDF documents and reduce the development and support costs by enabling your users to create and manage their document templates using a browser-based drag-and-drop document editor.
The PDF Generator API features a web API architecture, allowing you to code in the language of your choice. This API supports the JSON media type, and uses UTF-8 character encoding.
You can find our previous API documentation page with references to Simple and Signature authentication here.
Base URL
The base URL for all the API endpoints is https://us1.pdfgeneratorapi.com/api/v3
For example
https://us1.pdfgeneratorapi.com/api/v3/templateshttps://us1.pdfgeneratorapi.com/api/v3/workspaceshttps://us1.pdfgeneratorapi.com/api/v3/templates/123123
Editor
PDF Generator API comes with a powerful drag & drop editor that allows to create any kind of document templates, from barcode labels to invoices, quotes and reports. You can find tutorials and videos from our Support Portal.
Definitions
Organization
Organization is a group of workspaces owned by your account.
Workspace
Workspace contains templates. Each workspace has access to their own templates and organization default templates.
Master Workspace
Master Workspace is the main/default workspace of your Organization. The Master Workspace identifier is the email you signed up with.
Default Template
Default template is a template that is available for all workspaces by default. You can set the template access type under Page Setup. If template has "Organization" access then your users can use them from the "New" menu in the Editor.
Data Field
Data Field is a placeholder for the specific data in your JSON data set. In this example JSON you can access the buyer name using Data Field {paymentDetails::buyerName}. The separator between depth levels is :: (two colons). When designing the template you don’t have to know every Data Field, our editor automatically extracts all the available fields from your data set and provides an easy way to insert them into the template.
{
"documentNumber": 1,
"paymentDetails": {
"method": "Credit Card",
"buyerName": "John Smith"
},
"items": [
{
"id": 1,
"name": "Item one"
}
]
}Authentication
The PDF Generator API uses __JSON Web Tokens (JWT)__ to authenticate all API requests. These tokens offer a method to establish secure server-to-server authentication by transferring a compact JSON object with a signed payload of your account’s API Key and Secret.
When authenticating to the PDF Generator API, a JWT should be generated uniquely by a __server-side application__ and included as a __Bearer Token__ in the header of each request.
Legacy Simple and Signature authentication
You can find our legacy documentation for Simple and Signature authentication here.
Accessing your API Key and Secret
You can find your __API Key__ and __API Secret__ from the __Account Settings__ page after you login to PDF Generator API here.
Creating a JWT
JSON Web Tokens are composed of three sections: a header, a payload (containing a claim set), and a signature. The header and payload are JSON objects, which are serialized to UTF-8 bytes, then encoded using base64url encoding.
The JWT's header, payload, and signature are concatenated with periods (.). As a result, a JWT typically takes the following form:
{Base64url encoded header}.{Base64url encoded payload}.{Base64url encoded signature}We recommend and support libraries provided on jwt.io. While other libraries can create JWT, these recommended libraries are the most robust.
Header
Property alg defines which signing algorithm is being used. PDF Generator API users HS256.
Property typ defines the type of token and it is always JWT.
{
"alg": "HS256",
"typ": "JWT"
}Payload
The second part of the token is the payload, which contains the claims or the pieces of information being passed about the user and any metadata required.
It is mandatory to specify the following claims:
- issuer (
iss): Your API key - subject (
sub): Workspace identifier - expiration time (
exp): Timestamp (unix epoch time) until the token is valid. It is highly recommended to set the exp timestamp for a short period, i.e. a matter of seconds. This way, if a token is intercepted or shared, the…
Endpoints 11
Templates
- GETGet templates
/templatesReturns a list of templates available for the authenticated workspace - POSTCreate template
/templatesCreates a new template. If template configuration is not specified in the request body then an empty template is created. Template is placed to the workspace… - GETGet template
/templates/templateId?templateId=19375Returns template configuration - PUTUpdate template
/templates/templateId?templateId=19375Updates template configuration. The template configuration for pages and layout must be complete as the entire configuration is replaced and not merged. - DELETEDelete template
/templates/templateId?templateId=19375Deletes the template from workspace - POSTCopy template
/templates/templateId/copy?templateId=19375&name=My copied templateCreates a copy of a template to the workspace specified in authentication parameters. - POSTOpen editor
/templates/templateId/editor?templateId=19375&language=enReturns an unique URL which you can use to redirect your user to the editor from your application or use the generated URL as iframe source to show the editor…
Documents
- POSTGenerate document (multiple templates)
/templates/output?name=My document&format=pdf&output=base64Allows to merge multiples template with data and returns base64 encoded document or public URL to a document. NB! When the public URL option is used, the… - POSTGenerate document
/templates/templateId/output?templateId=19375&name=My document&format=pdf&output=base64Merges template with data and returns base64 encoded document or a public URL to a document. You can send json encoded data in request body or a public URL to…
Workspaces
- GETGet workspace
/workspaces/workspaceId?workspaceId=demo.example@actualreports.comReturns workspace information - DELETEDelete workspace
/workspaces/workspaceId?workspaceId=demo.example@actualreports.comDeletes the workspace
API details
- Base URL
https://us1.pdfgeneratorapi.com/api/v3- Authentication
- A bearer token in the Authorization header
- Operations
- 11 operations on 7 pathsPOST 5GET 3DELETE 2PUT 1
- Main resources
- Templates 7Documents 2Workspaces 2
- Description format
- OpenAPI 3.0.3, API version
3.1.1 - Links
- OpenAPI document · Support
- Listed from
- APIs.guru OpenAPI Directory (CC0-1.0)
Source updated
How to test the PDF Generator API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the PDF Generator API collection, without the publisher's secrets.
- Add your credentialsThis API uses A bearer token in the Authorization header. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “Get templates” (GET /templates), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the PDF Generator API?
Introduction PDF Generator API allows you easily generate transactional PDF documents and reduce the development and support costs by enabling your users to… It is listed under AI & machine learning and has 11 endpoints.
Who publishes the PDF Generator API?
It is listed from Pdfgeneratorapi's public API description (an OpenAPI document), not published by Pdfgeneratorapi on Swastik Codes. Anyone who controls pdfgeneratorapi.com can claim the profile by adding a DNS TXT record.
What is the base URL of the PDF Generator API?
Requests go to https://us1.pdfgeneratorapi.com/api/v3. Endpoint paths are added to this base URL.
How do I authenticate with the PDF Generator API?
With A bearer token in the Authorization header.
How many endpoints does the PDF Generator API have?
11 operations on 7 paths (5 POST, 3 GET, 2 DELETE, 1 PUT). The largest groups are Templates, Documents, Workspaces.
Is forking the PDF Generator API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.