Synchronous request
Synchronous means that when calling the API the request will wait for the pdf file to be generated before returning a response.
When to use it
Synchronous requests are useful when you want to get the results back immediately.
It is usually easier to use synchronous requests when integrating with no-code solutions such as Zapier.
If your server environment can deal with potentially having many long running connections open at the same time, then synchronous requests might be a good choice.
How to use it
Send a POST request to https://api.pdforge.com/v1/pdf/sync
Body params:
templateId
(required)
string
The id of your pdf template
data
object
The object containg the variables from your pdf template
convertToImage
boolean
If true, will return a .PNG file instead of a .PDF file (default: false)
s3_bucket
string
The id of the active s3 connection you want to store your generated file on.
(only available in the high plan)
s3_key
string
The path, including subdirectories and the filename without extension, to use when saving the render in your S3 bucket. (only available if being stored in custom s3_bucket)
The endpoint accepts only JSON data.
It's required to send the templateId
parameter.
If your template has variables, it's also required to send the data
object with your variables.
Request:
This endpoint responds with 200 OK
once the pdf has been generated with the following body:
The response body will contain a signedUrl
key which is a temporary URL pointing to the generated pdf file on our s3 bucket. This URL will expire after 1 hour.
Last updated