Messenger Platform

 
 
 

Airline 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.

Example Request

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

Fields

attachment object

Property Name Description Required

type

Value must be template

Y

payload

payload of boarding pass template

Y

payload object

Property Name Description Type Required

template_type

Value must be airline_boardingpass

String

Y

intro_message

Introduction message

String

Y

locale

Two-letter language region code

String

Y

theme_color

Background color of the attachment

String

N

boarding_pass

Boarding passes for passengers

Array of boarding_pass

Y

  • 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.

boarding_pass object

Property Name Description Type Required

passenger_name

Flight number

String

Y

pnr_number

Passenger name record number (Booking Number)

String

Y

seat

Seat number for passenger

String

N

auxiliary_fields

Flexible information to display in the auxiliary section

Array of field

N

secondary_fields

Flexible information to display in the secondary section

Array of field

N

logo_image_url

URL for the logo image

URI

Y

header_image_url

URL for the header image

URI

N

header_text_field

Text for the header field

field

N

qr_code

Aztec or QR code

String

Y, unless Image of the barcode is provided

barcode_image_url

URL of the barcode image

URI

Y, unless qr_code is provided

above_bar_code_image_url

URL of thin image above the barcode

URI

Y

flight_info

Information about the flight

flight_info object

Y

  • auxiliary_fields is limited to 5
  • secondary_fields is limited to 5
  • auxiliary_fields and secondary_fields are rendered left first to right last

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)

field object

Property Name Description Type Required

label

Label for the additional field

String

Y

value

Value for the additional field

String

Y