RegisterAlertEndpoint working but alerts are not POSTed

I’ve been using the FlightXML2 APIs for about a month now. So far it’s been straightforward. Support on these forums has been great.

I recently started implementing the push notification system for the app I’m building. I’m using the FlightXML methods RegisterAlertEndpoint/SetAlert/DeleteAlert etc. to setup alerts that trigger POSTs to my server when events of interest happen for flights I’m tracking.

I’ve verified that my server creates and deletes alerts correctly via the FlightXML API, and I’m able to set an alert endpoint without issue (RegisterAlertEndpoint responds with a success code).

Unfortunately, when alerts are meant to be posted, I’m seeing nothing in my server logs coming from FlightAware, and the alert screen on the website shows that there are errors - but not what the errors are. Again, suspecting my own mistake, I double-checked that the endpoint on my end is responding (currently it just logs the POST body and returns 200) and that the alerts are set and the endpoint is set correctly.

The only other thing I wondered about was the fact that my server is running on a Comcast home Internet connection (at a subdomain) while I’m in development, rather than a server hosted on a private domain. Does FlightXML not POST to some domains? Still, I’ve had no issues with other services that POST to my server just fine - there is no connectivity / NAT issue.

To help with debugging this, I thought I’d submit the results of calling /GetAlerts for my account. You can see the single alert that I have set below using the FlightXML API (Python dictionary parsed from JSON response and dumped to console):

 {u'user_ident': u'',
      u'origin': u'',
      u'ident': u'VRD29',
      u'description': u'Virgin America 29',
      u'date_end': 0,
      u'destination': u'',
      u'enabled': True,
      u'date_start': 0,
        {u'e_filed': True,
          u'channel_name': u'FlightXML push',
          u'e_cancelled': True,
          u'e_diverted': True,
          u'channel_id': 16,
          u'mask_summary': u'meetingFlight',
          u'e_arrival': True,
          u'e_departure': True}],
      u'alert_id': 1149933,
      u'aircrafttype': u'',
      u'alert_created': 1330760259,
      u'type': u'Form_Airline',
      u'alert_changed': 1330760259}]

It seems like the alert is correctly configured, though I do wonder why user_ident is empty (and what that field means). With an alert correctly configured, and an endpoint set, I can’t figure out why FlightXML is unable to post - especially because I can’t see what the errors are on the FlightAware side. When debugging this in the future, it might be useful to have a /GetAlertEndpoints method to verify the endpoints are set and a /GetAlertErrors method to see any problems sending alerts.

Please help me figure out why FlightXML isn’t POSTing alerts to my server :slight_smile:

Have you ensured that you have no firewalls that might be blocking our servers from reaching your endpoint URL?

Can you retry another alert? There have been some recent server fixes that may improve the reliability of push delivery.

I can confirm that this is now working. I didn’t need to change any firewall settings - port 80 was already open and the server was already getting POSTs from my iPhone client and from other 3rd party services. They just started working after trying this morning per your suggestion. Whatever server fixes your team implemented appear to have fixed the problem, so thanks for that!

Are push alerts an area of active development? I’m a little concerned about reliability. Were they not working or tested until recently? Are they likely to stop working again in the future?

Push alerts are new to flightxml and were not monitored as a production service. This was not well conveyed in the documentation.

They now have production service monitoring and should not experience this sort of outage in the future.

Fantastic! Does that mean there’ll also be some more documentation for alerts showing up? It’d be helpful to have a formal spec of the alert payload that I can expect to be posted to my server.

Thanks for the great support on these forums.