How to debug API Call flow (PDF Monkey)

Hi there,

I am generating a PDF using PDFmonkey .

I can successfully POST a Json request that generates a PDF Document. In response I can fetch the document ID.

Next step is to fetch the document by its ID (GET Api Call) to fetch the Download URL

Here I run into trouble

What I am not able to do is fetch the document’s download URL using the GET call directly after the POST call in the workflow. I also tried a pause event 1000ms in between.

What does work is to fetch the the Download URL using Postmad and also in Bubble in a separate workflow by a button click.

Any thoughts? Maybe I can try to zet a bigger pause.

As a workaround I am thinking to change the UX a bit to show Popup with a download Button. But ideally I just want to click on ‘Export PDF’ button generate the document and download it.

The side issue I am facing is that I can’t really debug the result of the GET Api call. I have no insight in the complete response and/or response code. Any tips how to debug?

If you do the POST call and the GET call in the same workflow then you need to make sure you do the POST call first and then reference a return from the first call in the second. If the first call does not return anything then you can use the checkbox at the bottom of each api call in the api connector to Include errors in response and allow workflow actions to continue. Now you can say do the GET call only when Result of Step 1's returned an error is no. This will ensure that the first call completely finishes before moving on to the next.

Thanks, I will try this. The order and published data from the response of the first call is working because I save the PDF document ID on the Thing (data type) in scope.

I think I will also add a process log saving all the redponse data of each call.

When you setup your api call and define the fields (id = text and so on) you need to make sure that the download_url parameter is of type file.

Also I recommend to use document_cards instead of the document since it is much smaller and does not contain the payload. If you need to use some specific values you can send them inside the meta object.

Inside your logger you can choose to see the servers requests and responses. And within pdfmonkey you can see the logs as well under the point webhooks.

Thanks.

Interesting to see that you can set the Download URL to file, I will try that.

I also changed to document_card, after reading the PDFmonkey docs again. Thanks for this tip also.

But still the download URL was empty after the GET call.

What does work is to save the document ID after Post, upon no errors I show a Popup with a button to download the PDF. This button navigates to an external website, which is set to the Document download URL from the GET response and this does work.

I anyone can share a working example of Post, Get and Download in one go, I would be glad to take a look.

In the meantime I will also try out the tips regarding debugging in both Bubble and PDFmonkey.

Tried it again (preview) and on free tier of PDF Monkey. Added HTTP Request/Response to Bubble’s server logging but don’t see anything appear there during testing.

I can’t get it to work in a single flow. For now the workaround with manual download button is working.

I also tried using the API as data instead of action without luck

If someone does get it to work it have it working I would like to have a sneakpeak into the configuration of the workflow.

Thanks in advance