Help using Search method with -latlong query


#1

I am trying to link to the flightXML api and I am struggling to get the ‘Search’ method to work with the -latlong query. I am using the JSON approach and the url I am calling is:

flightxml.flightaware.com/json/F … 5&offset=0

The query aspect seems to be incorrect and I am not sure why. Can anyone help tell me what I am doing wrong please?


#2

Try something like this:

flightxml.flightaware.com/json/F … latlong%20{50.0%20-3.0%2055.0%202.0}%20-inair%201&howMany=15&offset=0


#3

Hi,

Thanks for the reply. I tried the link you suggested:

flightxml.flightaware.com/json/F … latlong%20{50.0%20-3.0%2055.0%202.0}%20-inair%201&howMany=15&offset=0

and all I got back was:

{“SearchResult”:{“next_offset”:-1,“aircraft”:]}}

I am using safari and developing an iOS app using Xcode. Does that make any difference?


#4

You need to be sure the capitalization of inAir is correct:


https://flightxml.flightaware.com/json/FlightXML2/Search?query=-latlong%20{50.0%20-3.0%2055.0%202.0}%20-inAir%201&howMany=15&offset=0


#5

Thank you, the other aspect that I hadn’t sorted was that you needed to use https. I hadn’t appreciated that.


#6

http or https should both work equally. The only difference is whether you care about encrypting the request and response.


#7

I managed to get the request to work direct from the safari browser but when writing the request in Xcode for an iPhone app I have to escape the curly brackets as follows:

flightxml.flightaware.com/json/ … 5&offset=0

If I don’t escape the curly brackets I can’t create a valid URL to send the request. Unfortunately your server doesn’t seem to recognise the codes &7B and %7D. Have you come across this issue before? Do you know how I can resolve this?


#8

You can use the double-quote (") character instead of curly-quote characters as well.


#9

Thank you. That worked. I still needed to escape it but your servers seemed to accept that so all is well.

Thanks