# Why I'm having API response always null?

**URL:** <https://forum.bubble.io/t/why-im-having-api-response-always-null/36430>\
**Category:** APIs\
**Created:** [August 24, 2018, 4:59pm UTC](https://forum.bubble.io/t/why-im-having-api-response-always-null/36430 "2018-08-24T16:59:04Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ESS](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ess/32/28416_2.png) [@ESS](https://forum.bubble.io/u/ESS)\
**Post date:** [August 24, 2018, 4:59pm UTC](https://forum.bubble.io/t/why-im-having-api-response-always-null/36430/1 "2018-08-24T16:59:04Z")

</div>

Hi,  
I am new here, and I need!  
I am working on my first bubble app for a travel company solving the groups quote…  
I am using a few APIs in this app, all of them work just as expected, but the one for the flight search I couldn’t get it to work! I always get “null” as a response. The requested goes with no problem to the server.  
This same API works fine at all the browsers and at Postman without any issues.  
Also it works good in Bubble API plugin but within the application I’m building I only get empty repeating group no matter what I do…  
So, I’m not sure what I’m missing here?  
Any help to solve this problem… I will really appreciate it.  
here is some snapshot!

[b%20API%20Connector|445x500](https://forum.bubble.io/404)

This is the response at Bubble connector API:

 ![API%20Connector%20Results](https://us1.discourse-cdn.com/bubble/original/3X/7/5/75ca2aa70aee6e415d5cdd9d742d0204cee90dab.png)

Also when I use the API URL + Params + API key I get the following results:

 ![GoogleBrowser](https://us1.discourse-cdn.com/bubble/original/3X/f/a/fa2477c4cd4cb3d5c50392156ff01a4bae2a67a3.png)

So I’m sure the API, key and the params are all working fine, so within my application I did the following:  
I started setting up the group first as I did with my previous APIs;

 ![Group](https://us1.discourse-cdn.com/bubble/original/3X/2/5/25e56179fe6fa5ea78033e46d3cc49867c185d33.png)

I did the repeating Group as follow:

 ![RepeatingGroup](https://us1.discourse-cdn.com/bubble/original/3X/2/4/24e54b067c16d481bd92e59687f7ef3cebec133d.png)

And for displaying API response data on the repeating group I did the following:

 ![Displying%20data](https://us1.discourse-cdn.com/bubble/original/3X/5/c/5c87f53e2b3695dc0bdf1b05c1bf97ff6a37bf2f.png)

So similar sitting for the other APIs I’m still using in this app… but this is what I’m getting as a response even though all the requests show response status; 200 I still get empty response:

 ![Response](https://us1.discourse-cdn.com/bubble/original/3X/7/e/7ef6bb57adc4f09c7faefcac70b2adb541f721c0.png)

I’ve tried different things but the results are always the same.  
I’m not sure what I’m doing wrong.  
Any help on this is really appreciate it…  
Thank you.

---

<div class="post-metadata">

**Author:** ![ESS](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ess/32/28416_2.png) [@ESS](https://forum.bubble.io/u/ESS)\
**Post date:** [August 24, 2018, 5:09pm UTC](https://forum.bubble.io/t/why-im-having-api-response-always-null/36430/2 "2018-08-24T17:09:17Z")

</div>

Also I forgot to submit the snapshot of the API response data as an example:

 ![API%20requested%20data](https://us1.discourse-cdn.com/bubble/original/3X/7/5/7555f820cbbf38415a9b18e9a0967f6d1c2ae549.png)

---

<div class="post-metadata">

**Author:** ![dan1](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/dan1/32/23411_2.png) [@dan1](https://forum.bubble.io/u/dan1)\
**Post date:** [August 24, 2018, 5:11pm UTC](https://forum.bubble.io/t/why-im-having-api-response-always-null/36430/3 "2018-08-24T17:11:49Z")

</div>

Based on a quick look, it looks like you defined the data source on the parent group first and then displayed the results in the repeating group.

Try setting your data source to return results in the repeating group itself. (Ie. what you have as the Data Source on “Group Flight Results” move to “RepeatingGroup Getting\_Flights…”

---

<div class="post-metadata">

**Author:** ![ESS](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ess/32/28416_2.png) [@ESS](https://forum.bubble.io/u/ESS)\
**Post date:** [August 24, 2018, 5:13pm UTC](https://forum.bubble.io/t/why-im-having-api-response-always-null/36430/4 "2018-08-24T17:13:45Z")

</div>

Thank you Dan for your quick response.  
Ok I will try it right now…  
Thank you again

---

<div class="post-metadata">

**Author:** ![ESS](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ess/32/28416_2.png) [@ESS](https://forum.bubble.io/u/ESS)\
**Post date:** [August 24, 2018, 5:21pm UTC](https://forum.bubble.io/t/why-im-having-api-response-always-null/36430/5 "2018-08-24T17:21:31Z")

</div>

I just did what you’ve told me:

 ![2](https://us1.discourse-cdn.com/bubble/original/3X/e/7/e75296489a3b6f95c4f96e339781c95e8c4686db.png)

then:

 ![1](https://us1.discourse-cdn.com/bubble/original/3X/e/b/eb42f3ab58ea0af8a78e38600e185d3f1ba13e9a.png)

but still showing no results!!! it must be something else that I’m still doing wrong…

---

<div class="post-metadata">

**Author:** ![dan1](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/dan1/32/23411_2.png) [@dan1](https://forum.bubble.io/u/dan1)\
**Post date:** [August 24, 2018, 5:36pm UTC](https://forum.bubble.io/t/why-im-having-api-response-always-null/36430/6 "2018-08-24T17:36:11Z")

</div>

Provided you’re comfortable doing so, mind sharing a link to your app in a private message? Happy to take a look from there.

---

<div class="post-metadata">

**Author:** ![ESS](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ess/32/28416_2.png) [@ESS](https://forum.bubble.io/u/ESS)\
**Post date:** [August 24, 2018, 5:38pm UTC](https://forum.bubble.io/t/why-im-having-api-response-always-null/36430/7 "2018-08-24T17:38:14Z")

</div>

Sure! Thank you.  
Here is the link:

> **[Bubble Editor - tasolutions](https://bubble.io/page?type=page&name=dashboard&id=tcsolutions&tab=tabs-1)**
>
> Build stuff without code and launch a startup without a tech-cofounder! Bubble is a visual programing language. Instead of typing code, use a visual editor to build applications.

---

<div class="post-metadata">

**Author:** ![dan1](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/dan1/32/23411_2.png) [@dan1](https://forum.bubble.io/u/dan1)\
**Post date:** [August 24, 2018, 6:34pm UTC](https://forum.bubble.io/t/why-im-having-api-response-always-null/36430/8 "2018-08-24T18:34:21Z")

</div>

Spent a bit of time poking around. I think it has to do with the setup of the API.

I tried experimenting with a few different approaches. (Ie. one way, with infants, etc). You’re definitely getting responses from the API. But it likely needs other parameters that you’re not sending. (Ie. return date, infants). Try experimenting with making certain fields optional.

Though it looks like there may be two different search APIs based on the duration of the trip.

This was the common error I saw. You likely need to experiment with making some fields optional (if they can be optional - or sending a default value.

`Raw error from Flights_API - Getting_Flights: {"status":400,"message":"An ISO date or date range indicating the date on which the traveler will depart from the origin to go to the destination. Format should be YYYY-MM-DD[--YYYY-MM-DD]. The maximum scope for a date range is 2 days, for a larger scope, use the Extensive Search! Example: 2015-07-06--2014-07-07 or 2015-09-01."}`

---

<div class="post-metadata">

**Author:** ![ESS](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ess/32/28416_2.png) [@ESS](https://forum.bubble.io/u/ESS)\
**Post date:** [August 24, 2018, 7:00pm UTC](https://forum.bubble.io/t/why-im-having-api-response-always-null/36430/9 "2018-08-24T19:00:45Z")

</div>

Thank you Dan for your help and your time.  
Yes, I did play with all the fields as you said also I put some of them “optional” on the API connector, but without results.  
The only date required is the departure date, so when I only use the departure date I get no error popup message witch’s fine, but even with that I couldn’t get the results.  
The strange thing is: It works perfect on the browsers, in Postman and in API connector even with only the required field as Flying from data, flying to data and Departure date… but not in the app as you already saw for your self.  
It doesn’t make any sens…  
But thank you anyways Dan.

---

<div class="post-metadata">

**Author:** ![ESS](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ess/32/28416_2.png) [@ESS](https://forum.bubble.io/u/ESS)\
**Post date:** [August 24, 2018, 7:16pm UTC](https://forum.bubble.io/t/why-im-having-api-response-always-null/36430/10 "2018-08-24T19:16:06Z")

</div>

Finally! I’ve got it to work…!  
I’ve changed the date format and it works…  
Thank you Dan for your help.

---

<div class="post-metadata">

**Author:** ![dan1](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/dan1/32/23411_2.png) [@dan1](https://forum.bubble.io/u/dan1)\
**Post date:** [August 24, 2018, 7:23pm UTC](https://forum.bubble.io/t/why-im-having-api-response-always-null/36430/11 "2018-08-24T19:23:36Z")

</div>

Good to hear. What formatting of the date formats made things work correctly?

---

<div class="post-metadata">

**Author:** ![ESS](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ess/32/28416_2.png) [@ESS](https://forum.bubble.io/u/ESS)\
**Post date:** [August 24, 2018, 7:52pm UTC](https://forum.bubble.io/t/why-im-having-api-response-always-null/36430/12 "2018-08-24T19:52:54Z")

</div>

I used this format: yyyy-mm-dd  
and it works great!.
