"SetAlert" : Create alert 15 days before the flight


I want to create an alert for a specific flight 15 days before its departure.
As a continue of my discussion faFlightId is a dynamic value and as far as I understood there is high probability that there is no such faFlightId 15days before.

What would be a best strategy to create an alert for a particular flight in this case when there are no faFlightIds?

Let’s say my identifier

My departure time
1529884800 (06/25/2018 @ 12:00am (UTC))

According to the docs:

http://username:token@flightxml.flightaware.com/json/FlightXML2/SetAlert?ident=AFL2578&date_start=1529884800&channels="{16 e_departure e_arrival}" and then when POST request from flightAware comes - I will compare departureTime from scheduled flight and filed_departuretime from push ?

or filed_time or actualdeparturetime?

I think this approach can be broken when there are huge delays for flights… For a daily flight, one day delay could lead to a situation, when we have 2 flights with a tiny difference between actualdeparturetime values


The information contained in the alerts can also be used to update the existing alert configuration.

For instance, if the SetAlert is subscribed to e_filed in 1-2 hours in advance of the filed_departureTime you can anticipate receiving the faFlightID in a pushed notification before departure. You could then use this value to update the ident in your alert setting to make sure you only get the correct flight, even with a very large startDate and endDate window

More information about what fields can be expected in pushed alerts can be found in the Pushed Notifications section of the FlightXML 2 documentation.


I understood your approach with e_filed subscribing and updating the existing alert in my database.
But the situation I am trying to solve is a bit different:
Lets say AFL2578 flight identifier has two flights at the same day 06/25/2018 (morning and evening). User wants to subscribe for the flight in the evening.

When I SetAlert in flightaware services I can not specify which flight I want, because 15 days before I do not have faFlightId for the specific flight. Since date_start and date_end will be rounded to the day, it means on 06/25/2018 I will get pushes for two flights (1st for the morning, 2nd for the evening flight). Even if I subscribe to e_filed event I will get them for both flights, correct? How do I differentiate these two flights? What if morning flight has been delayed till the evening?


Given that a new flightid is not created for the delayed flight, the flightid would remain unchanged. You would differentiate them by using the morning flightid and not the evening flightid.