# PDF Generator API (How to get Json Payload?)

**URL:** <https://forum.adalo.com/t/pdf-generator-api-how-to-get-json-payload/24479>\
**Category:** Get Help\
**Created:** [March 12, 2022, 12:44am UTC](https://forum.adalo.com/t/pdf-generator-api-how-to-get-json-payload/24479 "2022-03-12T00:44:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![EdisonApps](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/edisonapps/32/16868_2.png) [@EdisonApps](https://forum.adalo.com/u/EdisonApps)\
**Post date:** [March 12, 2022, 12:44am UTC](https://forum.adalo.com/t/pdf-generator-api-how-to-get-json-payload/24479/1 "2022-03-12T00:44:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![colts88](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@colts88](https://forum.adalo.com/u/colts88)\
**Post date:** [March 12, 2022, 9:22am UTC](https://forum.adalo.com/t/pdf-generator-api-how-to-get-json-payload/24479/2 "2022-03-12T09:22:43Z")

</div>

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

In Adalo:

 ![Bildschirmfoto 2022-03-12 um 10.06.13](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/6/2/6262ec2f04688e9c312ba6f25f934faa30c36612.png)

In a [JSON Editor](https://jsoneditoronline.org/#left=local.coreve) and then saved and opened in my browser to check:  
 ![Bildschirmfoto 2022-03-12 um 10.15.37](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/1/b/1b2899bee2665299eae4b96ba118fcc0304ff025.png)

From there I opened the Template in [pdfgeneratorapi.com](http://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!

---

<div class="post-metadata">

**Author:** ![EdisonApps](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/edisonapps/32/16868_2.png) [@EdisonApps](https://forum.adalo.com/u/EdisonApps)\
**Post date:** [March 12, 2022, 2:21pm UTC](https://forum.adalo.com/t/pdf-generator-api-how-to-get-json-payload/24479/3 "2022-03-12T14:21:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![EdisonApps](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/edisonapps/32/16868_2.png) [@EdisonApps](https://forum.adalo.com/u/EdisonApps)\
**Post date:** [March 12, 2022, 2:49pm UTC](https://forum.adalo.com/t/pdf-generator-api-how-to-get-json-payload/24479/4 "2022-03-12T14:49:50Z")

</div>

So I used a JSON validator - [JSON Formatter & Validator](https://jsonformatter.curiousconcept.com/#) 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.

---

<div class="post-metadata">

**Author:** ![colts88](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@colts88](https://forum.adalo.com/u/colts88)\
**Post date:** [March 12, 2022, 3:19pm UTC](https://forum.adalo.com/t/pdf-generator-api-how-to-get-json-payload/24479/5 "2022-03-12T15:19:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![EdisonApps](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/edisonapps/32/16868_2.png) [@EdisonApps](https://forum.adalo.com/u/EdisonApps)\
**Post date:** [March 12, 2022, 3:23pm UTC](https://forum.adalo.com/t/pdf-generator-api-how-to-get-json-payload/24479/6 "2022-03-12T15:23:45Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![colts88](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@colts88](https://forum.adalo.com/u/colts88)\
**Post date:** [March 12, 2022, 3:30pm UTC](https://forum.adalo.com/t/pdf-generator-api-how-to-get-json-payload/24479/7 "2022-03-12T15:30:43Z")

</div>

haha thats probably the idea 😉  
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.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/system/32/40401_2.png) [@system](https://forum.adalo.com/u/system)\
**Post date:** [March 22, 2022, 3:31pm UTC](https://forum.adalo.com/t/pdf-generator-api-how-to-get-json-payload/24479/8 "2022-03-22T15:31:09Z")

</div>

Closed on March 22, 2022, 3:31pm UTC

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