Hello,
Connecting to flightaware api with 'Poll an External Website for JSON' . The Geoevent service works fine with just the base url
http://flightxml.flightaware.com/json/FlightXML2/SearchBirdseyeInFlight
The activeflight method allows to query and I setup the query part in 'parameter' part of input connector. The input connector stops working with the query part.
Has setting the parameter worked for anybody? Any thoughts or ideas or workarounds? Thanks in advance.
Hello J molk
May I ask what is the result if you were to manually construct the query URL by appending the parameters yourself and then see if it is resolvable on a web browser on the GeoEvent Server?
I see that the base URL needs authentication to access, so I am assuming you include that information in the Header Parameter Name:Value List field? Either way, it could be that the query string that is being added is either in a format that Geoevent cannot recognize or that it is in some way invalid.
Please see if you can test manually constructing the URL and then navigating to it in a browser. If that works to return the expected JSON, try seeing if you can use that URL as the value for the URL field in the input connector.
It would also be working double-checking that the MIME types included in the input connector are:
text/json, application/json
You can also check the Geoevent logs to see if any messages were logged for inaccessibility to the URL you provided.
Thanks for your response !!
Yes, the base url includes the credentials and is able to connect to flightaware successfully. When I put the query part of the url ( query={range lat 38.8863 40.897669} {range lon -79.03655 -77.1236} ) in the parameter field, the input connector doesn't work. Checked the log files and it gives error with ' invalid at index 135'. Looks like Geoevent doesn't recognize '=' or '{' To resolve the error, I encoded the query part of the url and that resolved the issue and now input is able to connect . However the data received from flightaware isn't queried. The data returned includes all lat/long
It appears that flightaware doesn't like the encoded url. The encoded url in a browser also return wrong data .
Any thoughts?
Understood. I agree that it would be a stretch for Geoevent to play nicely with the {} special characters. However, it may not matter if the URL in a browser does not work.
Put simply, Geoevent will read any data that is accessible at a certain endpoint. Whether that is just all of the JSON for a certain resource, or queried JSON, it's all the same to Geoevent. JSON is JSON. If it does not work in a browser, then it likely will not work in Geoevent.
-Daniel
Hi J molk,
So, I was able to make a connection and successfully query our tail numbers in SearchBirdseyeInFlight easily with Postman. Frustrating to say the least when I couldn't get the query that I wanted to work in GeoEvent Server. I just kept plugging away. The key for me was moving to the Post HTTP Method. I was then able to play around with URL Encoding in the Post Body in hopes of finding something that GeoEvent would accept it. It finally works!
Anyway - here is what I came up with....
Using Poll an External Website for JSON input:
The GeoEvent Definition looks like this:
Let me know how you make out - or already figured it out on your own!!!
--Adam
#geoevent #flight #flighttracking #flightxml #flightaware #firehose #cheaper #faa #avl
thanks Adam, I got it working.