Asynchronous request
Asynchronous means that the request will return immediately with a requestId (if the request passes validation), but the pdf file will be sent after a few seconds to your custom webhook.
Last updated
Asynchronous means that the request will return immediately with a requestId (if the request passes validation), but the pdf file will be sent after a few seconds to your custom webhook.
Last updated
Asynchronous requests are useful when you want to generate a large number of pdf reports or if you don't want to block your user experience while the pdf is being generated.
You can fire off the requests and wait for your webhook endpoint to be called with the requestId
.
We recommend using Asynchronous requests for a better performance on your application.
Send a POST request to https://api.pdforge.com/v1/pdf/async
Body params:
Name | Type | Description |
---|---|---|
The endpoint accepts only JSON data.
It's required to send both the templateId
and webhook
parameters.
If your template has variables, it's also required to send the data
object with your variables.
Request:
This endpoint responds with 200 OK
immediately with a renderId
, with the following response body:
After a few seconds, the pdf file will be generated and we will send a POST to your webhook with the following body:
The renderStatus could be either SUCCESS
or FAILED.
If the request FAILED
, you should contact support to figure why your pdf generation failed.
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.
templateId
(required)
string
The id of your pdf template
webhook
(required)
string
The url of your webook
data
object
The object containg the variables from your pdf template