Am I the only one pulling my hair out over sending JSONs to APIs?

I should preface this by saying that I’m not a coder and am quite a novice with JSON.

That being said, I’m pretty sure I’ve been sending correct structures to the below API, simply using text and some dynamic inputs followed by ‘JSON-safe’ as the prompt. I’m constantly having to try and remove quotation marks and re-structure it so that it doesn’t throw an error. I’ve contacted bubble support and they gave me some Regex which didn’t work and now I’m going through a list of hacky ways to get around it. Am I being simple or is this a common issue? It’s beyond frustrating.

Thanks in advance for any advice.

I would recommend testing your JSON in https://jsonlint.com/ always.

Also I would add the quotation marks inside the parameter’s value. That way you can then parse the prompt in a :formatted asJSON-Safe

eg. “text’ :

key: prompt / value “Tell me the time”

@ramaarana7 thanks for the advice. With your advice I think I’ve solved it - Google was giving a json body which included double quotations outside of the prompt and then JSON-safe was adding a second pair.

1 Like

nice!