SetAlert


#1

Hi,
I’m going to create SetAlert method for get flight arrival alerts. below show my code to create end point and SetAlert. i think creating end point is success and creating SetAlert occur an error. But didn’t display proper error massage. Please view my code and let me know if i made a mistake.
RegisterAlertEndpointResults registerAlertEndpointResults = df.registerAlertEndpoint(new RegisterAlertEndpointRequest(“my end point url”, “json/post”));

       SetAlertResults setAlertResults = df.setAlert(new SetAlertRequest(0, "", "", "CMB", "", 0, 0, "16 e_filed e_arrival e_diverted e_cancelled", true, 1000));********

Thanks


#2

Hi
"channels" string must be inside brackets
SetAlertResults setAlertResults = df.setAlert(new SetAlertRequest(0, “”, “”, “CMB”, “”, 0, 0, “{16 e_filed e_arrival e_diverted e_cancelled}”, true, 1000));

From docs:

For example this specifies a FlightXML Push channel with several flight statuses: “{16 e_filed e_departure e_arrival e_diverted e_cancelled}”

After this change you will get message
{
“error”: “FLOODWARN: This alert will trigger over 1000 flights a week. Please make it more restrictive.”
}

you need specify date_start - date_end, or one of the following properties: ident, origin, aircrafttype.

SetAlertResults setAlertResults = df.setAlert(new SetAlertRequest(0, “ALK229”, “”, “CMB”, “”, 0, 0, “{16 e_filed e_arrival e_diverted e_cancelled}”, true, 1000));
Working for me.

For arrival alerts only

SetAlertResults setAlertResults = df.setAlert(new SetAlertRequest(0, “ALK229”, “”, “CMB”, “”, 0, 0, “{16 e_arrival}”, true, 1000));


#3

Hi,
I’m going to create SetAlert but request fail. Please let me know if I made a mistake
Request:


Response:
{“error”:“APPFAULT: invalid channel_id specified in {channels}: %7B16”}

Thanks


#4

When I ran into this, it was because I needed to set the endpoint (the URL where the push notifications will be sent) in my account. This can be done via a call to RegisterAlertEndpoint in the Flight XML 2 API.