Dealing with non json api response

so I have this API post request that returns a text response, as you know bubble doesn’t parse that text into an object as it does with a json response.
the text response is a base 64 encoded json which I I can decode using a plugin but how can deal with it inside the app, all the api documentation only talks about what type of the responses you can get but not how to deal with them.

Do you have documentation link to API?

no it’s for a small shipping company and I can’t share it

So what I understand is this is your own API? Why do you encode the payload in base64?

no it’s not mine
it’s for a company but their api documentation are not public

1 Like

You don’t have a lot of options.
A) Store the JSON into a file and call this file url from API Connector. (File generator reader downloader Plugin | Bubble)
B) Send the JSON into a backend WF and process the JSON from there. May be more difficult with some JSON payload.
C) Use JSON plugin. But you could also face some limitation depending of the JSON payload and not always easy to use in frond end.
D) If the JSON is simple, use regex to parse needed value

I do this with a few API requests returning base64. Set up the API request as an action. Select text instead of json for response. In workflow, call the API. On the next step call decode base64 with the results of the API step then you can process that, store in a state, or a thing.

1 Like