Messenger Platform

 
 
 

Overview

With 900M monthly active users on the platform, Messenger allows businesses to form engaging relationships with their customers while scaling their reach. Businesses can also provide high-quality customer support while shifting volume to more efficient customer support channels. The airline integration for Messenger enables airlines to connect with users on Messenger during the ticket purchase flow, allowing users to receive their flight itinerary, check-in reminders, boarding passes and flight status updates within Messenger.

Pre-requisites for integration

Tech requirements

  • FB page messaging enabled
  • Integration with Send/Receive API
  • Messenger authentication plug-in on reservations page
  • Integration with CRM system to link PNR
  • Entry points to Messenger on airline owned surfaces (e.g., link/plug-in on email or website)
  • Live chat customer support

Organizational resources

The following teams within your company will likely need to be involved in the integration:

  • Marketing - Develop strategy for driving awareness and adoption for this channel
  • Engineering/IT- Support design, integration and maintenance requirements
  • Customer support - Coordinate between scaled contact center support and social media teams

Configure Your App

To get started, you'll need to create a Facebook app and Page (or use an existing one) and set it up as described in our Getting Started section. Your identity on Messenger is linked to your Facebook Page. You can create a new, separate Facebook page to accommodate the integration. The Facebook Page does not have to be public, but the name and profile pic is the one that will be used for customer engagement on Messenger. You'll then be able to use the plugins and templates specific to the airline experience outlined in this document.

User experience

The Messenger Airline experience starts on the airline web site. It is designed to be integrated in the checkout flow prior to the consummation of the ticket purchase. Here is the outline of the experience from a passenger's perspective:

  1. Authorization
    The Messenger Upsell plugin is displayed to customers as they make a flight selection but prior to the completion of the ticket purchase. This Upsell plugin allows customers to connect with the airline on Messenger. If customers are already logged into a Facebook session, their name and profile picture will appear and they will be required to confirm their identity on the confirmation pop-up. If an active session does not exist, customers will be prompted to enter their Facebook log-in information. They can choose to uncheck the plugin checkbox to opt-out of the experience on Messenger.

  2. Confirmation
    The Messenger Confirmation plugin is displayed to customers once their flight purchase is confirmed. This allows the airline to connect with the particular person on Messenger, and deliver mobile itinerary details, boarding pass and flight updates.

  3. Receiving updates
    After the purchase is confirmed, customers then receive their itinerary on Messenger with details of the booking. They will receive a note to remind them to check in ahead of time, and a mobile boarding pass will be sent to Messenger. Flight status updates will also be delivered within the Messenger conversation should the flight be delayed or gate information changed. They will also be able to communicate with your customer support team within the message thread. Any conversations with customers beyond the scope of these message types should comply with the Platform Policy.

Provide Customer Support

The Messenger Airline integration opens a conversation between customers and the airline's Facebook page. Some customers will have questions related to their booking and will use this channel to interact with the airline. Depending on how much you invest in driving awareness of this integration, you'll have varying degrees of volume coming through Messenger.

Airlines interested in building this user experience should integrate Messenger as part of their customer support processes. Our recommended list of Facebook Marketing Partners for community management can be found here. We recommend that you do your own diligence before selecting a partner to find the best fit for your business needs. If you currently work with a vendor who you do not see listed, please communicate with your representative about the status of their integration with Messenger.

Once you integrate with Messenger, you can see how your integration is performing under Messages in Page insights. This will help you track and maintain valuable experiences with your customers. Also, your provider may have their own dashboard and UI to provide you insight into the nature and volume of interactions.

Web Plugins and Account Linking

The Web Plugins and Account Linking API described in this section are under development. While we're finalizing these, you can start prototyping with the Send to Messenger plugin

We provide a set of web plugins to connect with people over Messenger. Using these plugins, you can authenticate a person and receive a page-scoped id that can be used to send messages.

To receive the page-scoped id after the plugin has been rendered use the Link API.

  • Link API - Links the user to your business on Messenger and returns a messenger user page-scoped id that can be used to communicate with that user.

Setup

All web plugins require our Javascript SDK. The SDK will dynamically render our plugins in your HTML.

Load the SDK in your page accordingly:

<body>
  <script>

    window.fbAsyncInit = function() {
      FB.init({
        appId      : '<APP_ID>',
        xfbml      : true,
        version    : 'v2.6'
      });

    };

    (function(d, s, id){
       var js, fjs = d.getElementsByTagName(s)[0];
       if (d.getElementById(id)) { return; }
       js = d.createElement(s); js.id = id;
       js.src = "//connect.facebook.net/en_US/sdk.js";
       fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));

  </script>

...

Please replace the APP_ID with your own app ID.

Upsell plugin


You can use the plugin by adding a special <div> tag to your page.

<div class="fb-messengerpreconfirmation" messenger_app_id="APP_ID" page_id="PAGE_ID"></div>

Confirmation plugin


You can use the plugin by adding a special <div> tag to your page.

<div class="fb-messengeraccountconfirmation" messenger_app_id="APP_ID" page_id="PAGE_ID" state="FILL_IN_YOUR_STATE"></div>

Plugin parameters

ParameterDescription

messenger_app_id

your app id

state

a UUID for the user that can be used to reference this plugin when receiving a Messenger page-scoped id

data-width

a custom width in pixels or percent for the plugin. e.g. "100" for 100 pixels, or "100%" to take up the full width

The state field can be used to pass arbitrary data to us. We pass this data back to you in the Link API so you can identify the user and transaction during which authentication took place.

Plugin events

There is a single JS event for the plugin: messengeraccountconfirmation.statusChange which has one callback argument with five possible values:

  1. {“status”: “checked”} - if the plugin is displayed and checked
  2. {“status”: “unchecked”} - if the plugin is displayed and unchecked
  3. {“status”: “notyou”} - if user clicks the not you link
  4. {“status”: “hidden”} - if for some reason we don't show the plugin (e.g. user is not logged in or has opted out or is gated)
  5. {“status”: “error”} - if there is any unknown error

You can subscribe to the event by doing:

FB.Event.subscribe(messengeraccountconfirmation.statusChange’, your_callback);

Every time the plugin renders, the user checks or unchecks the checkbox, or the user clicks "Not you," we will send the event. More information:

  • Plugin is checked by default: we send a checked event when it renders and an unchecked event when user unchecks it.
  • Plugin is unchecked by default: we send a “unchecked” event when it renders and a checked event when the user checks it.
  • Plugin is hidden (not rendered at all): we send the hidden event.

After the plugin has been rendered with a state parameter and the user moves to the next screen in your flow, you can get the Messenger page-scoped id for the user by calling the link API.

An example call is below:

curl -X POST -k -H "Content-Type: application/json" 'https://graph.facebook.com/link_with_state?access_token=<PAGE_ACCESS_TOKEN>' -d "{'states': ['abc']}"

This call is expected to return a response like

{
  "abc": {
      "link_status": "linked",
      "plugin_status": "checked", 
      "page_scoped_id": <PAGE_SCOPED_ID>
  }
}

POST parameters

ParameterDescription

access_token

your page access token

POST data

a JSON dictionary with one key: states. That key has a list of strings of the state parameters you wish to link (see previous section for the description of the state parameter)


Plugin statusLink statusOur actionAPI Response

checked

Not linked

Link the user

{"link_status":"linked", "plugin_status":"checked", "page_scoped_id":"12345"}

unchecked

Not linked

{"link_status":"not_linked", "plugin_status":"unchecked"}

notyou

Not linked

{"link_status":"not_linked", "plugin_status":"notyou"}

hidden

Not linked

Link the user

{"link_status":"not_linked", "plugin_status":"hidden"}

checked

Linked

{"link_status":"linked", "plugin_status":"checked", "page_scoped_id":"12345"}

unchecked

Linked

{"link_status":"linked", "plugin_status":"unchecked"}

notyou

Linked

{"link_status":"linked", "plugin_status":"notyou"}

hidden

Opt out

{"link_status":"opt_out", "plugin_status":"hidden"}

hidden

Cases other than "Opt out"

{"link_status":"unknown", "plugin_status":"hidden"}

Encrypting state Values

The state value could be the combination of the customer ID, order number, current time, and an HMAC of those values to ensure that the data was not changed in between. You can use your app_id's secret as the key. When you receive the value back from us through the POST, you can decide whether that is still a valid value.

Send Messages

Once you received a page-scoped ID for a person on Messenger, you will be able to send her updates and notifications using the Send/Receive API: itinerary, checkin reminder, boarding pass, and flight updates.

Itinerary Template

Send a confirmation message that contains the itinerary and receipt.

NameDescriptionTypeReq

template_type

airline_itinerary

string

Y

intro_message

introduction message to send before the structure message

string

Y

locale

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.

locale

Y

theme_color

background color of the attachment in RGB hexadecimal format (default #009ddc).

string

N

pnr_number

passenger name record number. This information is rendered as the Booking Number.

string

Y

passenger_info

information about a passenger (see details below)

passenger_info[]

Y

flight_info

information about a flight

flight_info[]

Y

passenger_segment_info

information unique to passenger/segment pair (see details below)

passenger_segment_info[]

Y

price_info

an itemization of the total price. A maximum of 4 items is allowed.

price_info[]

N

base_price

base price amount

float

N

tax

tax amount

float

N

total_price

total price for the booking

float

Y

currency

pricing currency e.g. USD

enum

Y


passenger_info Object:

NameDescriptionTypeReq

passenger_id

unique ID within an itinerary to identify the passenger

string

Y

ticket_number

ticket number

string

N

name

full name of the passenger, including titles

string

Y


flight_info Object:

NameDescriptionTypeReq

connection_id

unique ID within an itinerary used to group segments of a connection together

string

Y

segment_id

unique ID within an itinerary used to identify a flight segment

string

Y

flight_number

flight number

string

Y

aircraft_type

aircraft type e.g. Boeing 787

string

N

departure_airport

departure airport

airport

Y

arrival_airport

arrival airport

airport

Y

flight_schedule

schedule for the flight

flight_schedule

Y

travel_class

travel class

travel_class

N


passenger_segment_info Object:

NameDescriptionTypeReq

segment_id

unique ID within an itinerary used to identify a flight segment

string

Y

passenger_id

unique ID within an itinerary to identify the passenger

string

Y

seat

seat number for the passenger

string

N

seat_type

seat type for the passenger (e.g. Economy comfort)

string

N

product_info

a list of products the passenger purchased. A maximum of 4 products is allowed.

product_info[]

N


airport Object:

NameDescriptionTypeReq

airport_code

airport code e.g. SFO

string

Y

city

city name e.g. San Francisco

string

Y

terminal

terminal number

string

N

gate

gate number

string

N


flight_schedule Object:

NameDescriptionTypeReq

boarding_time

boarding time in departure airport timezone. Provided in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30).

string

N

departure_time

departure time in departure airport timezone. Provided in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30).

string

Y

arrival_time

arrival time in arrival airport timezone. Provided in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30).

string

Y


price_info Object:

NameDescriptionTypeReq

title

title for the price info

string

Y

amount

price amount

float

Y

currency

pricing currency e.g. USD

enum

N


product_info Object:

NameDescriptionTypeReq

title

title for the product info

string

Y

value

product short description

string

Y


travel_class Values (case insensitive):

  • ECONOMY
  • BUSINESS
  • FIRST_CLASS

Example

curl -X POST -H "Content-Type: application/json" 'https://graph.facebook.com/v2.6/me/messages?access_token=<PAGE_TOKEN>' -d '{
  "recipient": {
    "id": "USER_ID"
  },
  "message": {
    "attachment": {
      "type": "template",
      "payload": {
        "template_type": "airline_itinerary",
        "intro_message": "Here's your flight itinerary.",
        "locale": "en_US",
        "pnr_number": "ABCDEF",
        "passenger_info": [
          {
            "name": "Farbound Smith Jr",
            "ticket_number": "0741234567890",
            "passenger_id": "p001"
          },
          {
            "name": "Nick Jones",
            "ticket_number": "0741234567891",
            "passenger_id": "p002"
          }
        ],
        "flight_info": [
          {
            "connection_id": "c001",
            "segment_id": "s001",
            "flight_number": "KL9123",
            "aircraft_type": "Boeing 737",
            "departure_airport": {
              "airport_code": "SFO",
              "city": "San Francisco",
              "terminal": "T4",
              "gate": "G8"
            },
            "arrival_airport": {
              "airport_code": "SLC",
              "city": "Salt Lake City",
              "terminal": "T4",
              "gate": "G8"
            },
            "flight_schedule": {
              "departure_time": "2016-01-02T19:45",
              "arrival_time": "2016-01-02T21:20"
            },
            "travel_class": "business"
          },
          {
            "connection_id": "c002",
            "segment_id": "s002",
            "flight_number": "KL321",
            "aircraft_type": "Boeing 747-200",
            "travel_class": "business",
            "departure_airport": {
              "airport_code": "SLC",
              "city": "Salt Lake City",
              "terminal": "T1",
              "gate": "G33"
            },
            "arrival_airport": {
              "airport_code": "AMS",
              "city": "Amsterdam",
              "terminal": "T1",
              "gate": "G33"
            },
            "flight_schedule": {
              "departure_time": "2016-01-02T22:45",
              "arrival_time": "2016-01-03T17:20"
            }
          }
        ],
        "passenger_segment_info": [
          {
            "segment_id": "s001",
            "passenger_id": "p001",
            "seat": "12A",
            "seat_type": "Business"
          },
          {
            "segment_id": "s001",
            "passenger_id": "p002",
            "seat": "12B",
            "seat_type": "Business"
          },
          {
            "segment_id": "s002",
            "passenger_id": "p001",
            "seat": "73A",
            "seat_type": "World Business",
            "product_info": [
              {
                "title": "Lounge",
                "value": "Complimentary lounge access"
              },
              {
                "title": "Baggage",
                "value": "1 extra bag 50lbs"
              }
            ]
          },
          {
            "segment_id": "s002",
            "passenger_id": "p002",
            "seat": "73B",
            "seat_type": "World Business",
            "product_info": [
              {
                "title": "Lounge",
                "value": "Complimentary lounge access"
              },
              {
                "title": "Baggage",
                "value": "1 extra bag 50lbs"
              }
            ]
          }
        ],
        "price_info": [
          {
            "title": "Fuel surcharge",
            "amount": "1597",
            "currency": "USD"
          }
        ],
        "base_price": "12206",
        "tax": "200",
        "total_price": "14003",
        "currency": "USD"
      }
    }
  }
}'


Checkin Reminder Template

Send a check-in reminder message.

NameDescriptionTypeReq

template_type

airline_checkin

string

Y

intro_message

Introduction message to send before the structure message. If not provided, a default message will be sent.

string

Y

locale

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.

locale

Y

theme_color

background color of the attachment in RGB hexadecimal format (default #009ddc).

string

N

pnr_number

passenger name record number

string

Y

flight_info

array of information about a flight

flight_info[]

Y

checkin_url

URL for passengers to check-in

URL

Y


flight_info Object:

NameDescriptionTypeReq

flight_number

flight number

string

Y

departure_airport

departure airport

airport

Y

arrival_airport

arrival airport

airport

Y

flight_schedule

schedule for the flight

flight_schedule

Y


flight_schedule Object:

NameDescriptionTypeReq

boarding_time

boarding time in departure airport timezone. Provided in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30).

string

N

departure_time

departure time in departure airport timezone. Provided in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30).

string

Y

arrival_time

arrival time in arrival airport timezone. Provided in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30).

string

Y

Example

curl -X POST -H "Content-Type: application/json" 'https://graph.facebook.com/v2.6/me/messages?access_token=<PAGE_TOKEN>' -d '{
  "recipient": {
    "id": "USER_ID"
  },
  "message": {
    "attachment": {
      "type": "template",
      "payload": {
        "template_type": "airline_checkin",
        "intro_message": "Check-in is available now.",
        "locale": "en_US",
        "pnr_number": "ABCDEF",
        "flight_info": [
          {
            "flight_number": "f001",
            "departure_airport": {
              "airport_code": "SFO",
              "city": "San Francisco",
              "terminal": "T4",
              "gate": "G8"
            },
            "arrival_airport": {
              "airport_code": "SEA",
              "city": "Seattle",
              "terminal": "T4",
              "gate": "G8"
            },
            "flight_schedule": {
              "boarding_time": "2016-01-05T15:05",
              "departure_time": "2016-01-05T15:45",
              "arrival_time": "2016-01-05T17:30"
            }
          }
        ],
        "checkin_url": "https:\/\/www.airline.com\/check-in"
      }
    }
  }
}'


Boarding Pass Template

Send a message that contains boarding passes for one or more flights or one more passengers. Message bubbles will be grouped by flight information -- if the flight information matches, all passengers will be share the same bubble. Multiple bubbles are automatically sent for all boarding_pass elements with different values for flight_info. In the future, we may group all boarding passes into the same bubble.

Structured fields in the boarding pass object such as pnr_number or travel_class are not used in boarding pass display but may be used in the messenger bubble. passenger_name is displayed in the "Passenger name" block on the boarding pass.

NameDescriptionTypeReq

template_type

airline_boardingpass

string

Y

intro_message

introduction message to send before the structure message

string

Y

locale

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.

locale

Y

theme_color

background color of the attachment in RGB hexadecimal format (default #009ddc).

string

N

boarding_pass

boarding passes for passengers (see details below)

boarding_pass[]

Y


boarding_pass Object:

NameDescriptionTypeReq

passenger_name

passenger's name

string

Y

pnr_number

passenger name record number

string

Y

travel_class

travel class

enum

N

seat

seat number for the passenger

string

N

auxiliary_fields

flexible information to display in the auxiliary section. Fields are rendered left first to right last.

field[]

N

secondary_fields

flexible information to display in the secondary section. Fields are rendered left first to right last.

field[]

N

logo_image_url

Image for the logo field

URI

Y

header_image_url

Image for the header field

URI

N

header_text_field

text for the header field

field

N

qr_code

Aztec QR code. This parameter is required unless barcode_image_url is provided.

string

N

barcode_image_url

Image of the barcode. This parameter is required unless qr_code is provided.

URI

N

above_bar_code_image_url

Thin image above the barcode

URI

N

flight_info

information about the flight

flight_info

Y


flight_info Object:

NameDescriptionTypeReq

flight_number

flight number

string

Y

departure_airport

departure airport

airport

Y

arrival_airport

arrival airport

airport

Y

flight_schedule

schedule for the flight

flight_schedule

Y


flight_schedule Object:

NameDescriptionTypeReq

boarding_time

boarding time in departure airport timezone. Provided in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30).

string

N

departure_time

departure time in departure airport timezone. Provided in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30).

string

Y

arrival_time

arrival time in arrival airport timezone. Provided in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30).

string

N


field Object:

NameDescriptionTypeReq

label

label for the additional field

string

Y

value

value for the additional field

string

Y


travel_class Values (case insensitive):

  • ECONOMY
  • BUSINESS
  • FIRST_CLASS

Example

curl -X POST -H "Content-Type: application/json" 'https://graph.facebook.com/v2.6/me/messages?access_token=<PAGE_TOKEN>' -d '{
  "recipient": {
    "id": "USER_ID"
  },
  "message": {
    "attachment": {
      "type": "template",
      "payload": {
        "template_type": "airline_boardingpass",
        "intro_message": "You are checked in.",
        "locale": "en_US",
        "boarding_pass": [
          {
            "passenger_name": "SMITH\/NICOLAS",
            "pnr_number": "CG4X7U",
            "travel_class": "business",
            "seat": "74J",
            "auxiliary_fields": [
              {
                "label": "Terminal",
                "value": "T1"
              },
              {
                "label": "Departure",
                "value": "30OCT 19:05"
              }
            ],
            "secondary_fields": [
              {
                "label": "Boarding",
                "value": "18:30"
              },
              {
                "label": "Gate",
                "value": "D57"
              },
              {
                "label": "Seat",
                "value": "74J"
              },
              {
                "label": "Sec.Nr.",
                "value": "003"
              }
            ],
            "logo_image_url": "https:\/\/www.example.com\/en\/logo.png",
            "header_image_url": "https:\/\/www.example.com\/en\/fb\/header.png",
            "qr_code": "M1SMITH\/NICOLAS  CG4X7U nawouehgawgnapwi3jfa0wfh",
            "above_bar_code_image_url": "https:\/\/www.example.com\/en\/PLAT.png",
            "flight_info": {
              "flight_number": "KL0642",
              "departure_airport": {
                "airport_code": "JFK",
                "city": "New York",
                "terminal": "T1",
                "gate": "D57"
              },
              "arrival_airport": {
                "airport_code": "AMS",
                "city": "Amsterdam"
              },
              "flight_schedule": {
                "departure_time": "2016-01-02T19:05",
                "arrival_time": "2016-01-05T17:30"
              }
            }
          },
          {
            "passenger_name": "JONES\/FARBOUND",
            "pnr_number": "CG4X7U",
            "travel_class": "business",
            "seat": "74K",
            "auxiliary_fields": [
              {
                "label": "Terminal",
                "value": "T1"
              },
              {
                "label": "Departure",
                "value": "30OCT 19:05"
              }
            ],
            "secondary_fields": [
              {
                "label": "Boarding",
                "value": "18:30"
              },
              {
                "label": "Gate",
                "value": "D57"
              },
              {
                "label": "Seat",
                "value": "74K"
              },
              {
                "label": "Sec.Nr.",
                "value": "004"
              }
            ],
            "logo_image_url": "https:\/\/www.example.com\/en\/logo.png",
            "header_image_url": "https:\/\/www.example.com\/en\/fb\/header.png",
            "qr_code": "M1JONES\/FARBOUND  CG4X7U nawouehgawgnapwi3jfa0wfh",
            "above_bar_code_image_url": "https:\/\/www.example.com\/en\/PLAT.png",
            "flight_info": {
              "flight_number": "KL0642",
              "departure_airport": {
                "airport_code": "JFK",
                "city": "New York",
                "terminal": "T1",
                "gate": "D57"
              },
              "arrival_airport": {
                "airport_code": "AMS",
                "city": "Amsterdam"
              },
              "flight_schedule": {
                "departure_time": "2016-01-02T19:05",
                "arrival_time": "2016-01-05T17:30"
              }
            }
          }
        ]
      }
    }
  }
}'


Flight Status Updates Template

Send flight status update message.

NameDescriptionTypeReq

template_type

airline_update

string

Y

intro_message

introduction message to send before the structure message. You must pass at least one of intro_message or update_type

string

Y

update_type

type of update for this notification. used for the text sent along with the message bubble. You must pass at least one of intro_message or update_type.

enum

Y

locale

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.

locale

N

theme_color

background color of the attachment in RGB hexadecimal format (default #009ddc).

string

N

pnr_number

passenger name record number

string

Y

update_flight_info

information about a flight

update_flight_info

Y


update_flight_info Object:

NameDescriptionTypeReq

flight_number

flight number

string

Y

departure_airport

departure airport

airport

Y

arrival_airport

arrival airport

airport

Y

flight_schedule

schedule for the flight

flight_schedule

Y


flight_schedule Object:

NameDescriptionTypeReq

boarding_time

boarding time in departure airport timezone. Provided in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30).

string

N

departure_time

departure time in departure airport timezone. Provided in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30).

string

Y

arrival_time

arrival time in arrival airport timezone. Provided in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30).

string

N


update_type Values (case insensitive):

  • DELAY
  • GATE_CHANGE
  • CANCELLATION

Example

curl -X POST -H "Content-Type: application/json" 'https://graph.facebook.com/v2.6/me/messages?access_token=<PAGE_TOKEN>' -d '{
  "recipient": {
    "id": "USER_ID"
  },
  "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"
          }
        }
      }
    }
  }
}'


International

Localization

The Airlines template contain a locale parameter. This parameter causes the strings controlled by Facebook for a specific locale to be rendered in the requested language. See our list of supported locales for the list of valid locales. See the Facebook Developers page on localization for a more general understanding of localization with Facebook apps.

If a locale is passed in that does not match one of our supported locales, we will default the country code portion of the locale according to the following table.

two-character language codeDefault locale

br

pt_BR

cn

zh_CN

da

da_DK

de

de_DE

en

en_GB

fi

fi_FI

fr

fr_FR

hk

zh_HK

id

id_ID

it

it_IT

ja

ja_JP

ko

ko_KR

nl

nl_NL

no

nb_NO

pl

pl_PL

pt

pt_PT

ru

ru_RU

sv

sv_SE

th

th_TH

tr

tr_TR

tw

zh_TW

uk

uk_UA

all others

en_GB