Bubble API Connector: Input Text Requirements

I have an API call that takes two inputs.

When I call it from Bubble, I get a 500 error when one of the inputs is the following block of text. However, it does work when I call the API from a jupyter notebook with the same inputs.

I own the API, so I took a look at the error that was being produced. Below is a screenshot of the error and the code that it is referring to. It looks to me like Bubble isn’t sending the request body.
Screenshot 2024-11-03 at 1.32.04 PM
Screenshot 2024-11-03 at 1.32.28 PM

I have seen this article ( Hard limits | Bubble Docs), but I don’t think that I’m hitting any of these limits. The text is only ~5,000 characters and can be encoded to utf-8.

What am I missing?

Make sure you’re doing :format as JSON safe after the text value. This escapes any characters that would break the JSON formatting like linebreaks and other characters.

Keep it mind that adds quotes on each side of the text already so take those out of the API connector setup if needed.

Thank you so much. This has solved the problem

1 Like