Problem solving error on POST API connector - Preview form throws error


I am new to the API connector. I have set up a POST API to send data in a form from a page in my bubble site to a db in Xano. I have set up the json Body and initialised the API + confirmed this is being received (new records created in db) in Xano. So far all fine.

I then set up the workflow for the form on the page. Issue is when I press the submit button on the form (in Preview mode), I get the below error message and nothing makes it through to Xano.

‘Temporary error connecting to xxxxx (raw message: {“message”:“Error parsing JSON: Syntax error”})’

I have checked everything I can think of. E.g. checked field types match between the API call in the workflow and those in the code in the connector. I think that they do (text, numbers and lists).
Header has content-type: application/json . I have toggled this between optional and not in the checkbox and error throws both times.
Body type is JSON
Capture response headers is currently checked but again, I have tried it unchecked also.

The other datapoint is that I had the same form almost working yesterday when I set it up the key value pairs in the Parameters field rather than copy-pasting from Swagger into the Body box. What prompted the change is that I have some list/array fields and understood that these would not work unless I set up in the JSON Body box.

Any ideas gratefully received!

Thanks, Antony

Do you have any dynamic data in the json body that you are trying to send through the form. Or you are trying the same data in the json body that you tested in the API connector?

And can you please provide any screenshots of both workflow and connector setup?

It might help somebody to figure out the problem.


I figured this one out using chatgpt and jsonlint in the end. I was trying to put through different data in the form with dynamic <>s in the json body. It was my very rookie (mis)understanding of json/javascript formatting dynamic inputs in the json code that led to the error. The root of it was I hadn’t understood that I would need “” marks for dynamic entries whether these were string/text form or number/decimal/integer form. Once I figured this out everything started triggering to Xano (which gave me a bunch of other errors to fix, but these were immediate to diagnose).
The settings with everything working were the same as I described above (just in case anyone else reads struggling with same error), except I now have the content type / application/json in the header without the optional box ticked, and the ‘capture response headers’ at the bottom is also unchecked. I don’t know whether these make a difference - but the first time I got it working this was their status and so I’m sticking with it for now!

Glad it’s working. Wishing you good luck with your project.