Forum Academy Marketplace Showcase Pricing Features

API Connector "The response is not valid JSON"

Hi @emmanuel and @NigelG, thanks for your time. im using the ApiConnector to be able to track clicks in a button with google analytics Api.
The connection configuration its very simple. take a look.

when I test it here in the Apiconnector it works and the api call do a succesfull POST request. But when i preview and try the button an apiconnector alert display, showing that response from google anaytlics servers its not valid JSON and button workflow breaks. It´s curious becouse even with the error the POST request succesfully do the call.

Thank you, regards

I have the exact same situation when using a POST call to Slack.
In Postman and when initializing the call in the api connector it works great. But when using it as an action, it throws this error. Still, the API call comes through…
Could it be because the call doesn’t recieve any return values?

1 Like

Have you confirmed the API is JSON based? A lot of google apis are xml based for instance (quite archaic…)

Google send you back a gif header as well as the 200 request. You can see it on Postman in the header of the response.

I think Bubble is having an issue with this when there is no actual body of the response. It should probably ignore it.

The API I’m using (Slack) when getting the same error is json based. It’s a webhook for Slack, and the call is like this:

I think you are right Nigel. :slight_smile: