The airline flight update template allows you to send a structured message that contains a updated flight information. For complete implementation details, see Airline Flight Update Template.
https://graph.facebook.com/v2.6/me/messages?access_token=<PAGE_ACCESS_TOKEN>
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>'
{ "recipient_id": "1254477777772919", "message_id": "mid.$cAAJsujCd2ORj_1qmrFdzhVa-4cvO" }
recipient
Description of the message recipient. All requests must include one of id
, phone_number
, or user_ref
.
Property | Type | Description |
---|---|---|
| String | Either |
| String | Optional. Phone number of the recipient with the format +1(212)555-2368. Your bot must be approved for Customer Matching to send messages this way. |
| String | Optional. |
| Object | Optional. Used only if {"first_name":"John", "last_name":"Doe"} Providing a name increases the odds of a successful match. |
message
Property | Type | Description |
---|---|---|
| Object | An object describing attachments to the message. |
message.attachment
Property | Type | Description |
---|---|---|
| String | Value must be |
| Object |
|
message.attachment.payload
Property Name | Type | Description |
---|---|---|
| String | Value must be |
| String | Introduction message |
| String | Optional. Background color of the attachment. Must be a RGB hexadecimal string. Defaults to #009ddc. |
| String | Type of update. Must be 'delay', 'gate_change' or 'cancellation'. |
| String | Two-letter language region code. 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. |
| String | Optional. The Passenger Name Record number (Booking Number). |
| String | Updated flight information. |
message.attachment.payload.update_flight_info
Property | Type | Description |
---|---|---|
| String | Flight number |
| Object | |
| Object | |
| Object | Schedule for the flight. See flight_schedule. |
message.attachment.payload.boarding_pass.flight_info.flight_schedule
Property Name | Type | Description |
---|---|---|
| String | Optional. Boarding time in departure airport timezone. Must be in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30). |
| String | Departure time in departure airport timezone. Must be in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30). |
| String | Optional. Arrival time in arrival airport timezone. Must be in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30). |
message.attachment.payload.boarding_pass.flight_info.departure_airport
Property | Type | Description |
---|---|---|
| String | Airport code of the departure airport. |
| String | Departure city of the flight. |
| String | Terminal of the departing flight. |
| String | Gate for the departing flight. |
message.attachment.payload.boarding_pass.flight_info.arrival_airport
Property | Type | Description |
---|---|---|
| String | Airport code of the arrival airport. |
| String | Arrival city of the flight. |
| String | Terminal of the departing flight. |
| String | Gate for the departing flight. |