Messenger Platform

 
 
 

Airline Flight Update Template

Send flight status update message.

  • The color of airplane image on web version of template is black.

Example Request

curl -X POST -H "Content-Type: application/json" -d '{
  "recipient": {
    "id": "<PSID>"
  },
  "message": {
    "attachment": {
      "type": "template",
      "payload": {
        "template_type": "airline_update",
        "intro_message": "Your flight is delayed",
        "update_type": "delay",
        "locale": "en_US",
        "pnr_number": "CF23G2",
        "update_flight_info": {
          "flight_number": "KL123",
          "departure_airport": {
            "airport_code": "SFO",
            "city": "San Francisco",
            "terminal": "T4",
            "gate": "G8"
          },
          "arrival_airport": {
            "airport_code": "AMS",
            "city": "Amsterdam",
            "terminal": "T4",
            "gate": "G8"
          },
          "flight_schedule": {
            "boarding_time": "2015-12-26T10:30",
            "departure_time": "2015-12-26T11:30",
            "arrival_time": "2015-12-27T07:30"
          }
        }
      }
    }
  }
}' 'https://graph.facebook.com/v2.6/me/messages?access_token=<PAGE_ACCESS_TOKEN>'

Example Response

{
  "recipient_id": "1254477777772919",
  "message_id": "mid.$cAAJsujCd2ORj_1qmrFdzhVa-4cvO"
}  

Fields

attachment object

Property Name Description Required

type

Value must be template

Y

payload

payload of update template

Y

payload object

Property Name Description Type Required

template_type

Value must be airline_update

String

Y

intro_message

Introduction message

String

N

update_type

Type of update for this notification

String

Y

locale

Two-letter language region code

String

Y

theme_color

Background color of the attachment

String

N

pnr_number

Passenger name record number (Booking Number)

String

Y

update_flight_info

Information about a flight

update_flight_info

Y

  • update_type must be delay, gate_change or cancellation
  • theme_color must be a RGB hexadecimal string (default #009ddc)
  • locale must be a two-letter ISO 639-1 language code and a ISO 3166-1 alpha-2 region code separated by an underscore character. Used to translate field labels (e.g. en_US). See this document for more information about Facebook's locale support.

update_flight_info object

Property Name Description Type Required

flight_number

Flight number

String

Y

departure_airport

Departure airport

airport object

Y

arrival_airport

Arrival airport

airport object

Y

flight_schedule

Schedule for the flight

flight_schedule object

Y

flight_schedule object

Property Name Description Type Required

boarding_time

Boarding time in departure airport timezone

String

N

departure_time

Departure time in departure airport timezone

String

Y

arrival_time

Arrival time in arrival airport timezone

String

N

  • boarding_time, departure_time and arrival_time must be in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30)