FlightAware Discussions

FAFlightID received by push does not exactly match what was registered

Sometimes, the FAFlighID we receive by a call to our flight alert receiver does not exactly match the FAFlightID we used when setting the alert.

For example:
A few days before the flight, we create the alert via:
ident = "QFA400"
departureTime = 1507143600
faFlightId = FlightXML2Soap.GetFlightID(ident, departureTime)

This returns “QFA400-1506970800-schedule-0004”.
We register the alert with
FlightXML2Soap.SetAlert(0, faFlightId, null, null, null, 0, 0, "{16 e_departure e_arrival e_diverted e_cancelled}", true, 1000);

Sometime later, we receive a call to our alert receiver, with
faFlightID = "QFA400-1506970800-schedule-0004:1"

Now we can’t figure out which of our users to deliver the alert to, because we have no record of this flight id (because of the extra “:1”)

Full example response:

{"long_desc":"Qantas #400 arrived at Sydney (SYD) at 07:17AM AEDT from Melbourne Tullamarine (MEL)\n\nDestination (Sydney / SYD): Terminal 3, Gate 4","short_desc":"QFA400 arrived at SYD from MEL","summary":"QFA400 arrived at SYD from MEL","eventcode":"arrival","alert_id":22849145,"flight":{"ident":"QFA400","aircrafttype":"A332","origin":"YMML","destination":"YSSY","filed_ete":"00:48:00","route":"DCT DOSEL Y59 RIVET","faFlightID":"QFA400-1506970800-schedule-0004:1","reg":"VHEBE","filed_altitude":410,"filed_airspeed_kts":458,"filed_time":1507140963,"filed_departuretime":1507143600,"estimatedarrivaltime":1507148247,"actualarrivaltime":1507148247,"actualdeparturetime":1507144380,"estimated_blockin_time":1507148460,"filed_blockin_time":1507148700,"actual_blockin_time":0,"estimated_blockout_time":1507143600,"filed_blockout_time":1507143600,"actual_blockout_time":1507143720,"filed_arrivaltime":1507146480}}

I had to add a rule to my data parser specifically to remove the extra :1, :2, :3… etc. from the end of FlightAware’s flight ID’s. I never figured out exactly what the pattern was, but, it was consistent for a few different flights (as in, some specific flights would always trigger the :x issue).

In any event, I’ve seen it too; it’s a bug that should be corrected on FlightAware’s end, but, should be something you can handle on your end too - just check to see if the second from last char in the ID is a “:”, if it is, truncate the last two chars of the ID and move along.

OK, thanks. Good to know this strategy is working for others

Apparently we are not returning the base flight id when sending alerts. The :1, :2, etc represent different forks of a flight that are created based on different permissions. I think we’re going to update the alert engine to strip off the fork and return the base_id only.

1 Like

Thanks that is good to know!

I guess updating the alert engine means V3?