Problem submitting JSON payload

I am calling the OpenAI API and getting an error 400, “We could not parse the JSON body”.

what I am sending is a text that has been formatted as JSON-safe in bubble.

Also, when I copy the payload and send it with Postman, i am getting a proper response.

Has anyone made any experience cleaning up the payload to be sent to OpenAI or any other API using the formatted as JSON-safe operator in bubble?

found the problem. When you format as JSON-safe bubble wraps whichever text you have with " ". However, if in the body of the API you are also wrapping the text with " " it turns you are adding " twice, as in “” “” - and that is not JSON-safe.


This topic was automatically closed after 70 days. New replies are no longer allowed.