I set up an API with Postmark through the Bubble API connector. My website sends ~1000 emails per month and it’s been working perfectly well for the past 6 months with 0 error.
Now since ~5 days, I have seen an increased number of API calls to Postmark failing. Postmark error codes are multiple (1122, 403…) and they seem to be related to JSON sent by Bubble that are considered invalid/malformed.
After some digging, I suspect that this might be caused by how Bubble treats spaces in JSON dynamic values: one space used to be replaced by “null”. So when i did not want to use the CC field for example, I was just putting a space (not an empty field, a space as in hitting the space bar once) instead. But Bubble might treat this space differently now. I am not 100% sure though.
1/ Anyone else is seeing errors resulting from their postmark api calls lately?
2/ What’s the easiest way to see exactly what JSON was sent from Bubble? I can’t see that in the server logs (enabling http request and http response in the advanced settings in the server logs tab does not help either)?
It is indeed!
I just heard back from Postmark support. It turns out I had a few things I had to get fixed in the headers of my API calls and a trailing comma in one of my JSONs. Previously my postmark API calls were working with 100% success rate. Now that they are checking JSONs more carefully, some but not all my API calls were failing. Here’s postmark answer to why my API calls were sporadically returning an error:
We’ve started this rollout with a very small % of our traffic. You’ll want to address this now, as this rollout will complete later this year and at that point it would not sporadically happen.
Let me know if you have any other questions on this."
Also as an FYI, I ended up using requestbin to see the exact Json that bubble is sending to Postmark. There is no option to see that Json in Bubble’s server logs, and that was confirmed to me by Bubble support, who actually suggested I use requestbin. It’s then easy to check the JSONs with a json validator online.
Hello, and thank you in advance for your help. I’m encountering errors with my Postmark API calls. Unfortunately, I’m unable to identify which part of the JSON is causing the issue. Would you mind sharing how you use the request in your call? I’ve tried various approaches with inspectors and other tools, but I haven’t been able to retrieve the JSON. Thank you very much.
Open a free account on requestbin.com. Copy the url generated by requestbin
Go to the Api connector section of Bubble and replace the url of the API that is failing with the url generated by requestbin
Trigger your Workflow involving this API
Go to requestbin: you will have access to the JSON that Bubble sent
Copy paste that Json in an online json validation service like jsonlint.com for example. This will pinpoint exactly where there is an error on your Json