# API Connector "The response is not valid JSON"

**URL:** <https://forum.bubble.io/t/api-connector-the-response-is-not-valid-json/6416>\
**Category:** APIs\
**Created:** [September 27, 2016, 5:55pm UTC](https://forum.bubble.io/t/api-connector-the-response-is-not-valid-json/6416 "2016-09-27T17:55:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![julian](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/julian/32/5221_2.png) [@julian](https://forum.bubble.io/u/julian)\
**Post date:** [September 27, 2016, 5:55pm UTC](https://forum.bubble.io/t/api-connector-the-response-is-not-valid-json/6416/1 "2016-09-27T17:55:39Z")

</div>

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.

 ![](https://us1.discourse-cdn.com/bubble/original/2X/1/19597f5612ae00ceb0023afb7c5d7f197a5cc983.png)

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.

![](https://us1.discourse-cdn.com/bubble/original/2X/c/c563aca5ec0c55812ae9d4a761e0f975b4b6c30b.png)

 ![](https://us1.discourse-cdn.com/bubble/original/2X/1/10c1f22101408a1572d363b9c3b57e4f32f0d03d.png)

Thank you, regards

---

<div class="post-metadata">

**Author:** ![pnodseth](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pnodseth/32/2611_2.png) [@pnodseth](https://forum.bubble.io/u/pnodseth)\
**Post date:** [September 27, 2016, 9:39pm UTC](https://forum.bubble.io/t/api-connector-the-response-is-not-valid-json/6416/2 "2016-09-27T21:39:04Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [September 28, 2016, 5:29am UTC](https://forum.bubble.io/t/api-connector-the-response-is-not-valid-json/6416/3 "2016-09-28T05:29:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [September 28, 2016, 6:10am UTC](https://forum.bubble.io/t/api-connector-the-response-is-not-valid-json/6416/4 "2016-09-28T06:10:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pnodseth](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/pnodseth/32/2611_2.png) [@pnodseth](https://forum.bubble.io/u/pnodseth)\
**Post date:** [September 28, 2016, 7:08am UTC](https://forum.bubble.io/t/api-connector-the-response-is-not-valid-json/6416/5 "2016-09-28T07:08:54Z")

</div>

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:

 ![](https://us1.discourse-cdn.com/bubble/original/2X/b/bc3ffbedfcd6bb60a0105fe1b6db507fcc3d43c8.png)

I think you are right Nigel. 🙂
