REST / API Calls
To get a detailed list of all available API Calls check out our API Documentation.
Use curl to generate PDF
After uploading a PDF and creating your placeholders you will get an API key and PDF key you can use to easily generate your PDFs.
curl -H 'Content-Type: application/json' \
-d '{"apiKey":"264Hd_iJkdfkasfkajsdf4HdpRNABdEVcvlCjroEvI","variables":{"NameField":"Example Value"},"images":{}}' \
https://api.cloudfill.io/api/pdf/ad1E8nES3FNKQv3r4lPlhVRe_nwPvffss5EnXIU90/generate
The result will be a JSON with the URL to your PDF file.
{
"url" : "https://api.cloudfill.io/api/download/sSgqQkxP32mfSv02hT5gfvbU84A_B24ETKh8vtbjNvU"
}
Use this URL to download your PDF. Depending on your subscription type it will be available for 30-90 days. You can either directly download the PDF using that URL or send it to your customers. To customize the filename of the PDF simply append the URL with the desired filename. For example to use filename.pdf: https://api.cloudfill.io/api/download/abcdefgh/filename.pdf
Embed Images into PDFs
You can replace fields with images instead of text by using the images property when generating a PDF.
The following example places a text inside the TextField and replaces the field ImageField with the image available from https://example.com/logo.png.
{
"variables": { "TextField": "My replacement text" },
"images": {
"ImageField": {
"url": "https://example.com/logo.png"
}
}
}
Make sure that the image is publically available on that URL at the time of generating the PDF! The following image formats are supported:
- PNG
- JPEG