Parse API response

I am in too deep trying to figure out how to parse this JSON. I thought bubble was meant to parse it automatically, which makes me assume I am in the wrong in some way. Love any insight.

I’m using OpenAi’s API.

This is my playground.
https://beta.openai.com/playground/p/TbAkCC9TkWsNAg9jgTg4tJzc?lang=curl

Please help, this tech is sick and I want to use it!

So with from what i understand i need to use the JS JSON.parse () function. ill look into plugins.

I’m trying to do the same thing. Have experimented with some json plugins but not got it working.

Did you figure it out in the end? Imagine lots of people will want to do this!

@jamesdevonport do you have any API that returns such results, will be happy to look into it?

Ankur@Nocodetalks
Looking for a Bubble Coach? Buy Bubble.io mentorship

1 Like

The link in the op is a link to the playground api that gave that response.

Oh man, if you can figure this out I think you’ll provide something that will provide value to a lot of people. I just don’t think enough no/low coders realise how easy AI is yet, and to be honest, parsing the data is my only setback from creating some pretty mind blowing functionality which I assume many people will eventually be in the same position.

Feel free to ask anything and I’ll get back to you, or even grab a call.

1 Like

There was one json plug-in that did help, it’s kinda slow. I could identify one parameter and extract a value in a workflow.

I’m out on a walk right now but when I’m back at my comp I’ll find the plug-in.

@bkerryk

This is what it is returning and inside the “text” key, its string type data, not the JSON data.

1 Like

Actually it is JSON. But it is being ‘escaped’ so that " becomes /" etc

You can probably just do a find and replace but that then means you have textual JSON in Bubble, without the fields being parsed.

2 Likes

Thanks for the suggestion @NigelG, I’m now getting the below Json back into Bubble nicely formatted.

I’m struggling to work out how I use this data in Bubble though, I really want to store it to the DB in a backend workflow… assuming I will need some kind of Json > Bubble plugin but not found anything.

Any pointers super appreciated!

I’ve read in the forumm somewhere that we can send it through an backend workflow and get it to format correctly but I have tried and I can’t figure it out.

As @NigelG said, we have textual JSON and we need it to be parsed. I can’t imagine this hasn’t be documented somewhere on bubble forum, I just can’t find it.

@jamesdevonport I’m right with you mate, we’ll figure it out one day!

Any developments on this one?
I have the same issue

I have been working on getting the playground to start and stop each of the fields with a * or something so I can possibly split by.

There must be a solution to this. I’ve been searching for weeks, but I can’t find a way to do it. I’m trying to explore if there is a way to structure the API prompt in such a way to return a response that bubble will recognize as JSON instead of text. If this can be solved, it can open an amazing potential for really cool functionality.

I’m still eager for a solution but haven’t been actively looking. Keeping my eyes out though!

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