PDF Generator API (How to get Json Payload?)

I’m using the PDF Generator API, I’ve scoured the tutorials for how to get the JSON payload to upload to the template. Where is this generated from? It’s not clear how I get the variables from Magic Text into the payload by typing the code out. Any help is greatly appreciated.

Hi,
I typed it out manually. Here the example:

In Adalo:

In a JSON Editor and then saved and opened in my browser to check:
Bildschirmfoto 2022-03-12 um 10.15.37

From there I opened the Template in pdfgeneratorapi.com and uploaded the JSON file by opening. I added datafields to the text-fields I had. Then I was able to connect my text-fields with the corresponding field in the JSON.

Sorry I am not a very technical person. I did that a two days ago and that worked for me. But I never worked with anything JSON related or the whole API stuff. I guess there is a better solution to export the JSON out of the Adalo Component, but no idea. Hope this helps!

Thanks for commenting. No matter what I input into the JSON editor I continue to get a parse error, eExpecting ‘STRING’, ‘}’, got ‘undefined’. I even simplified it what you provided above, and still received the same error. Is the second field, where you put “Input”, just the field name from the database in Adalo?

This seems simple enough, but I can’t get past the errors.

So I used a JSON validator - JSON Formatter & Validator and it was able to correctly format the payload to work. I also had to close out of the PDF Generator website and clear my cache, then copy and paste the JSON file. That seemed to work.

Glad to hear. And yes my “Input” was just the field name in Adalo.
Hope it works now for you.

1 Like

Only issue I’m running into now, is the output is not pulling from the logged in user’s info correctly. It’s overwriting each row with the same info, instead of unique items for each line, but at least the PDF is being generated now! 1 win at a time I guess!

haha thats probably the idea :wink:
I didn’t come further than my test I did with one field. I will test tomorrow if I run into the same issue like you when I try to build a real template and connect it to more than just one user input.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.