Alerts Response Element

The Alerts response is returned for the following request type:

When requesting creation of a new rule a capabilities element will be returned in addition to the rule created, unless the extended option "skipValidation" is supplied. The capabilities element indicates the current likeliness that FlightStats will be able to detect and emit alerts related to a few key events. Capabilities are based on data sources and subject to change at any time.

See the specification for handling event notification Alert Message Callbacks.

Alert Rule
Element Cardinality Description
<rule> 0..n Holder element for an Alert Rule.
<id>110994477</id> 1..1 The id of the rule to be used for retrieval or deletion.
<name>Example</name> 1..1 The name of this rule as provided or assigned by default otherwise.
<description>Example Description</description> 0..1 The supplied description of this rule, if any.
<carrierFsCode>HA</carrierFsCode> 0..1 The FlightStats unique code for the carrier to use as a reference for finding the entry in the appendix (unless the extended option to include inlined references is used).
<carrier> ... </carrier> 0..1 Details for the carrier (if using the extended options to include inlined references, otherwise the carrier details will be present in the appendix). Airline Fields
<flightNumber>25</flightNumber> 1..1 The flight identification number and any additional characters (String).
<departureAirportFsCode>JFK</departureAirportFsCode> 0..1 The FlightStats unique code for the departure airport to use as a reference for finding the entry in the appendix (unless the extended option to include inlined references is used).
<departureAirport> ... </departureAirport> 0..1 Details for the departure airport (if using the extended options to include inlined references, otherwise the airport details will be present in the appendix). Airport Fields
<arrivalAirportFsCode>LHR</arrivalAirportFsCode> 0..1 The FlightStats unique code for the arrival airport to use as a reference for finding the entry in the appendix (unless the extended option to include inlined references is used).
<arrivalAirport> ... </arrivalAirport> 0..1 Details for the arrival airport (if using the extended options to include inlined references, otherwise the airport details will be present in the appendix). Airport Fields
<departure>2012-10-30T10:15:00.000</departure> 0..1 The local date and time of the departure in ISO-8601 format. yyyy-MM-dd'T'HH:mm:ss.SSS
<arrival>2012-10-30T13:10:00.000</arrival> 0..1 The local date and time of the arrival in ISO-8601 format. yyyy-MM-dd'T'HH:mm:ss.SSS
<ruleEvents> 1..1 Holder for the event rules that will trigger alerts.
<ruleEvent> 1..n An event rule to trigger an alert on.
<type>PRE_DEPARTURE_STATUS</type> 1..1 The type of the event to trigger an alert on.
<value>60</value> 0..1 Configured parameter value for events that accept or require additional specification.
</ruleEvent>
</ruleEvents>
<nameValues> 0..1 Holder for any custom name/value pairs registered with the rule.
<nameValue> 0..n Holder for a custom name/value pair.
<name>customName</name> 1..1 The name provided.
<value>customValue</value> 1..1 The value provided.
</nameValue>
</nameValues>
<delivery> 1..1 Holder element for the alert delivery configuration.
<format>JSON</format> 1..1 The format of the message that will be delivered, JSON or XML.
<destination>http://example.com/alert</destination> 1..1 The destination URL to which alerts will be posted
</delivery>
</rule>
Capabilities
Element Cardinality Description
<alertCapabilities> 1..1 The expected alerting capabilities for the registered rule.
<baggage>false</baggage> 1..1 The likely chance that baggage information will be detected (Boolean).
<departureGateChange>false</departureGateChange> 1..1 The likely chance that departure gate changes will be detected (Boolean).
<arrivalGateChange>false</arrivalGateChange> 1..1 The likely chance that arrival gate changes will be detected (Boolean).
<gateDeparture>false</gateDeparture> 1..1 The likely chance that flight gate departure will be detected (Boolean).
<gateArrival>false</gateArrival> 1..1 The likely chance that flight gate arrival will be detected (Boolean).
<runwayDeparture>true</runwayDeparture> 1..1 The likely chance that flight runway departure will be detected (Boolean).
<runwayArrival>true</runwayArrival> 1..1 The likely chance that flight runway arrival will be detected (Boolean).
</alertCapabilities>
Airline
Element Cardinality Description
<fs>AA<fs> 1..1 The FlightStats code for the carrier, globally unique across time (String).
<iata>AA<iata> 0..1 The IATA code for the carrier (String).
<icao>AAL<icao> 0..1 The ICAO code for the carrier (String).
<name>American Airlines<name> 1..1 The name of the carrier (String).
<phoneNumber>1-800-433-7300</phoneNumber> 0..1 The primary customer service phone number for the carrier (String).
<active>true</active> 1..1 Boolean value indicating if the airline is currently active (Boolean).
<category>A</category> 0..1 NEW The category of operation of the airline:
Value Description Passenger Cargo
A Scheduled Passenger Carrier Y N
B Non-Scheduled Passenger Carrier Y N
C Scheduled Cargo Carrier N Y
D Non-scheduled Cargo Carrier N Y
I Scheduled Passenger/Cargo Carrier Y Y
J Non-scheduled Passenger/Cargo Carrier Y Y
K Railway Service Y Y
Fields marked as NEW will only be returned if the extended option "includeNewFields" is used. See the Flex API Version Policy page for details.
Airport
Element Cardinality Description
<fs>PDX</fs> 1..1 The FlightStats code for the airport, globally unique across time (String).
<iata>PDX</iata> 0..1 The IATA code for the airport (String).
<icao>KPDX</icao> 0..1 The ICAO code for the airport (String).
<faa>PDX</faa> 0..1 The FAA code for the airport (String).
<name>Portland International Airport</name> 0..1 The name of the airport (String).
<street1>7000 Northeast, Airport Way</street1> 0..1 The street address of the airport, part 1 (String).
<street2></street2> 0..1 Street address of the airport, part 2 (String).
<city>Portland</city> 1..1 The city with which the airport is associated (String).
<cityCode>PDX</cityCode> 0..1 The city code with which the airport is associated (String).
<district>Chaoyang</district> 0..1 NEW The district of the city in which the airport is located (String).
<stateCode>OR</stateCode> 0..1 The State in which the airport is located (String).
<postalCode>97216</postalCode> 0..1 The postal code in which the airport resides (String).
<countryCode>US</countryCode> 1..1 The code for the country in which the airport is located (String).
<countryName>United States</countryName> 1..1 The name of the country in which the Airport is located (String).
<regionName>North America</regionName> 1..1 The name of the region in which the Airport is located (String).
<timeZoneRegionName>America/Los_Angeles</timeZoneRegionName> 1..1 The name of the Time Zone region in which the Airport is located (String).
<weatherZone>ORZ006</weatherZone> 0..1 The NOAA weather zone (US only) in which the Airport is located (String).
<localTime>2012-08-09T11:02:59.571</localTime> 1..1 The local time at the Airport when the request was made in ISO-8601 format. yyyy-MM-dd'T'HH:mm:ss.SSS.
<utcOffsetHours>-7.0</utcOffsetHours> 1..1 The current UTC offset at the Airport when the request was made (Double).
<latitude>40.642335</latitude> 1..1 The latitude of the airport in decimal degrees (Double).
<longitude>-73.78817</longitude> 1..1 The longitude of the airport in decimal degrees (Double).
<elevationFeet>30</elevationFeet> 1..1 The elevation above sea level of the airport in feet (Integer).
<classification>1</classification> 1..1 The FlightStats classification of the airport, 1(max) to 5(min). (Integer).
<active>true</active> 1..1 Boolean value indicating if the airport is currently operational (Boolean).
Fields marked as NEW will only be returned if the extended option "includeNewFields" is used. See the Flex API Version Policy page for details.
Example XML Output
The following example is a partial response and uses inline references for simplicity.
See Full Sample Responses for a complete response.
<rule> <id>110994477</id> <name>Example</name> <carrierFsCode>HA</carrierFsCode> <flightNumber>25</flightNumber> <departureAirportFsCode>PDX</departureAirportFsCode> <arrivalAirportFsCode>HNL</arrivalAirportFsCode> <departure>2012-10-30T10:15:00.000</departure> <arrival>2012-10-30T13:10:00.000</arrival> <ruleEvents> <ruleEvent> <type>DEPARTURE</type> </ruleEvent> <ruleEvent> <type>ARRIVAL</type> </ruleEvent> <ruleEvent> <type>DIVERTED</type> </ruleEvent> <ruleEvent> <type>CANCELLED</type> </ruleEvent> <ruleEvent> <type>PRE_DEPARTURE_STATUS</type> <value>60</value> </ruleEvent> <ruleEvent> <type>DEPARTURE_GATE</type> </ruleEvent> <ruleEvent> <type>BAGGAGE</type> </ruleEvent> </ruleEvents> <nameValues> <nameValue> <name>customName</name> <value>customValue</value> </nameValue> </nameValues> <delivery> <format>JSON</format> <destination>http://example.com/alert</destination> </delivery> </rule> <alertCapabilities> <baggage>false</baggage> <departureGateChange>false</departureGateChange> <arrivalGateChange>false</arrivalGateChange> <gateDeparture>false</gateDeparture> <gateArrival>false</gateArrival> <runwayDeparture>true</runwayDeparture> <runwayArrival>true</runwayArrival> </alertCapabilities>
Example JSON Output (whitespace added for clarity)
The following example is a partial response and uses inline references for simplicity.
See Full Sample Responses for a complete response.
rule: { id: "110994059", name: "Example", carrierFsCode: "HA", flightNumber: "25", departureAirportFsCode: "PDX", arrivalAirportFsCode: "HNL", departure: "2012-10-30T10:15:00.000", arrival: "2012-10-30T13:10:00.000", ruleEvents: [ { type: "DEPARTURE" }, { type: "ARRIVAL" }, { type: "DIVERTED" }, { type: "CANCELLED" }, { type: "PRE_DEPARTURE_STATUS", value: 60 }, { type: "DEPARTURE_GATE" }, { type: "BAGGAGE" } ], nameValues: [ { name: "customName", value: "customValue" } ], delivery: { format: "JSON", destination: "http://example.com/alert" } } alertCapabilities: { baggage: false, departureGateChange: false, arrivalGateChange: false, gateDeparture: false, gateArrival: false, runwayDeparture: true, runwayArrival: true }
Full Sample Responses