API Connector :The API call returns a non-object and you picked JSON

Hi,

An API call I already use for some time is suddenly broken and I don’t know why.
It is just calling an URL from Instagram with someones InstaHandle to get some basic information.
If I just try the call in the browser it replies a JSON object, but Bubble doesn’t seem to get the reply or format it in the right way. Strange, because it has worked before.
Every time I try to initialize the call it gives “The API call returns a non-object and you picked JSON”.

My API setup:

Reply in the browser:

Thanks!

You seem to call the instagram website and not the API. So this is not returning json but HTML
Do the same call in insomnia or postman and check the content-type in header. It will show you what is the type of data.

Thanks for the quick response.
It is HTML, but it has worked before and I could access all data that was send back with this call…
Any idea how to fix this?

The only suggestion I can tell you if this was working before is to contact Bubble Support. MAybe they have made a change on their side that create this issue (but it may be Instagram too).

I have some workaround, but I think that the first thing to do is to contact support.
Workaround can be complex depending on how you use the call.

I was trying to get this to work the other day.

I posted here: Get JSON from open URL

Same issue but I didn’t have it setup previously.

Depending of your use case, you can: USe the api connecter, but set data to be type text.
Create another call that will post to a backend workflow with the correct json header and use backend workflow to detect data.

Another option is to create a plugin that will manage the json payload. It’s more complex and can take a lot of time if you have a lot of data.

Finally, you can use a third party tool like Integromat that will be able to parse the data and return it to API Connector (or backend workflow)

Hitting the URL in the browser is working fine but getting either Bubble or now integromat to hit is resulting in a block. Looks like instagram have blocked requests from these URLs when they aren’t authenticated even though a non authenticated browser request works.

That’s exactly it. I filed a bug report, hopefully they have more information about it on their systems…

1 Like