Forum Academy Marketplace Showcase Pricing Features

This API Just Will Not Work

This API connects to an airport database of names.

https://www.air-port-codes.com/airport-codes-api/multi/

I copy their sample input and also the script side by side on the bubble page and nothing happens…

Am I missing something?

API key is configured correct in the script and URL added to the API back end correctly. I don’t understand why it’s not working.

Can you share a sample app/code for community members to take a look at?

The script from their site isn’t an API. It is some code, and as such won’t run.

You need to ask them how to access the API natively. Or maybe find another provider.

I thought so! I’ll shop around and ask them. Thanks Nigel!

Can this one be configured through Bubble? Or is it in the same boat as the other one?

https://www.developer.aero/Airport-API/API-Overview

Have limited experience working with API’s. Thanks for the help!

1 Like

Yes, that looks better. I tried to set an account up but it didn’t seem to work :frowning:

One issue that I’m facing is that none of the existing api’s seem to be ‘auto complete’. I am thinking that the setup of my system vs. the api is what is wrong here instead of anything in bubble.

I would love the following to occur as the user types but…:

I can’t seem to locate an API that does this auto complete in this fashion.

It seems all the API’s out there (or at lease the ones I’ve found and tested) allow the user to input a airport code, press ‘SEARCH’ and obtain the result of that search or in my testing it responds when the field is changed in bubble as well.

That is fine on my end but I need to understand how to SAVE THE RESPONSE data in seperate fields.

Right now it keeps giving me a ‘type conflict’ it seems where the API Connection is of one ‘type’ even though I don’t think I’ve set one or am able to change it’s type vs. the field which I’m trying to populate to the database which is of the type “flight”. As you can see below I have no option for ‘flight’ it seems.

What I’m trying to do at the very least is allow the user to search by airport code which obtains a response containing all the below information and have those individual pieces of airport information saved as fields within the application’s “flight” listing thing.

This is the error I face. I think it’s something small on my end but I do not know…

It keeps asking me to go one more level in, (text) which works but only gives me ONE of the responses I need not all pieces of the response which I can break into different fields and add/make changes to ‘flight’ with…?

As you can see going one further level in and pulling the ‘airport name’ based on ICAO code is the only option i’ve got.

I also seem to get an API error for a 404 for some reason:

And I can’t seem to switch once 1 api call is made, it doesn’t allow me to switch airport codes and call it again by the looks of things.

I have created a test app for this here so you can see my settings:

https://testingapplication604.bubbleapps.io/version-test/flight_code?debug_mode=true

I am open to any which way I can get this to work.

All I need is to be able to 1) allow user to search an airport code 2) save the response as ‘flight’ and make changes to fields within ‘flight’.

OK, so I think I can do it, but it is going to be very tricky to do the autocomplete.

As per the other thread, I think it is going to be a lot easier to import the list of airports and search (autocomplete) against that.

We can get a list of airport codes back from the API, and into a list (I stored it on the User). But then autocomplete doesn’t work on lists only things and the only way to create a list of things from a list (AFAIK) is to schedule an API on a list.

So in the example in the we could probably create a group of things on page load that we could autocomplete against. But that seems like quite a complicated way to do it.

Do you want to the user to be able to seach against ALL airports, or just within an particular area for that user ?

I agree with you that that is too complicated.

The way I see it is Autocomplete should be done natively within Bubble using a downloaded list of airport information from OurAirports.com. I just cannot get it to import.

The issue on this thread is concerning this type conflict I’m constantly facing where I cannot save individual pieces of the API response as inputs into the db. It keeps giving me the type conflict above but I have no ability to change the type so that it all works!

Hi Justincrabbe, did you ever find a solution? I work with air-port-codes.com and can assist you with setup if you need. We have made many improvements over the last few months that you might like, including adding more example documentation and sample code to help you get things working.

Here is some documentation on getting autocomplete working on your website.
https://www.air-port-codes.com/airport-codes-api/multi/installation/#jqueryui_with_autocomplete_functionality

Let me know if you have any troubles with it.