Headers
Request Header | Description |
---|---|
key | Service Key |
content-type | application/json |
Response
This API may return the following response codes:
Response Code | Message | Description |
---|---|---|
1001 | Queued | Returned when the request is accepted by IMIconnect. |
7000 | Invalid JSON | Returned when an invalid JSON request is sent. |
7001 | Authentication failed | Returned when an invalid service key or profile key is provided in the request. |
7002 | Service key missing | Returned when the parameter key is missing in the message request. |
7003 | Mandatory parameters missing | Returned when the mandatory parameters configured in custom event are missing. |
7004 | Invalid parameters | Returned when the parameters are invalid. |
7006 | Internal error occurred | Returned when an internal error occurs. |
7007 | Service inactive | Returned when the service is in inactive state. |
7009 | Max number of destinations | Returned when an API request exceeds the limit (1000) to send messages using messaging API. |
{
"correlationid":"<Unique transaction ID from the client end>",
"notifyurl":"<Notifications will be sent to the URL specified here>",
"callbackData":"<Identifier sent alongside notifications to the notifyurl>",
"expiry":"<Expiry time in UTC format, after which messages will not be pushed.Foe example, 2015-04-12T13:00:19.456Z or 2015-04-12T18:30:19.456+5:30>",
"priority":"<Accepts numbers 1-low, 2-medium, and 3-high>",
"deliverychannel":"fb/twitter/wa/wechat",
"message":{
"template":"<Message template ID.>",
"parameters":{
"parameter1":"<value>",
"parameter2":"<value>",
"parameter3":"<value>"
}
},
"channels":{
"smartlinks":[
{
"linkid": "<specifies the link id that is generated for a smartlink using IMIconnect. >",
"validity": "<Specifies the time in minutes after which the link will expire>"
}
],
"OTT-Messaging":{
"fb":{
"attachment": {
"type": "<type of attachment: image/template>",
"payload": {
"template_type": "<type of template: generic/buttons/receipt>",
"elements": [{
"title": "<bubble title>",
"image_url": "<image url that opens when bubble is tapped>",
"subtitle": "<subtitle for a bubble>",
"buttons": [{
"type": "<options for button: web_url/postback>",
"url": "<Applicable when button type is web url. Specifies the url that opens in a browser when button is tapped>",
"title": "<url title>",
"payload": "<Applicable when type is postback. A user defined payload that is used in rules>"
}]
}
]
}
}
}
}
},
"destination":[
{
"customerid/psid/twitterid/wechat_user_id":[
"<value1>",
"<value2>"
],
"correlationid":"<A unique transaction ID up to 50 bytes used by Client to match requests with responses. Will override correlationid given in request body.>"
},
{
"customerid/psid/twitterid/wechat_user_id":[
"<value1>",
"<value2>"
],
"correlationid":"<A unique transaction ID up to 50 bytes used by Client to match requests with responses. Will override correlationid given in request body.>"
}
]
}
Parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
text | String | Yes | Specifies the message text. Note: Either text _or _attachment or sender_action is mandatory. |
attachment | JSONObject | Yes | A block consists of the following parameters:
Note: Either text _or _attachment or sender_action is mandatory. |
notification_type | String | No | Specifies the notification to be received with a sound or without sound. The options are:
|
sender_action | String | Yes | Specifies the message state. The options are:
Note: Either text _or _attachment or sender_action is mandatory. |
quick_replies | JSONArray | No | Specifies an options in the text message to reply back to the sender. When the quick reply is tapped, the message is sent with the option tapped. Once the message is sent, the options disappear. |
Channels
The channels parameter block configures channel communication parameters for channel-specific features.
{
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"text": "Welcome to IMIconnect"
}
}
},
"destination": [{
"psid": ["1207588322640336"]
}]
}
Facebook - Sender Action
Sender action feature allows you to set typing indicators or send read receipts to let users know that someone is typing or the message is read. Typically this feature is used in chat conversations. When you are processing a time consuming request, you can send a typing indicator. The typing indicator gives an impression to your users that someone is replying to their request. For more information on sender action, click here.
{
"appid": "",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"sender_action" : "typing_on"
}
}
},
"destination": [
{
"psid":["1207588322640336"]
}
]
}
Facebook - Quick Replies
Quick Replies are buttons with some text that appears above the text composer. Users can tap on the button to respond to the message. Once the message is tapped, the options disappear. You can add up to 10 buttons. These buttons are useful to get a specific response from the users. You can configure buttons to have a plain text or a combination of text and image. You can also configure a button with location, so that users can send geographic location in the conversation. You can configure the button with a payload that can have custom data that will be sent back to the enterprises through a webhook. For additional information on Quick Replies, click here.
Parameter | Type | Mandatory | Description |
---|---|---|---|
content_type | String | Yes | Specifies the type of content. The options are:
|
title | String | Yes. This is applicable only when content_type is set as text. | Specifies the caption for button. You can add upto 20 characters as title. |
payload | String | Yes. This is applicable only when content_type is set as text. | Specifies the custom data that will be sent back to you through webhook. The limit of this payload is 1000 characters. |
image_url | String | No | Specifies the URL of the image sent as quick_replies. |
{
"appid": "",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"text": "Customer id check 1",
"quick_replies": [{
"content_type": "text",
"title": "Red",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED"
}, {
"content_type": "text",
"title": "Green",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_GREEN"
}, {
"content_type": "text",
"title": "Yellow",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_YELLOW"
}, {
"content_type": "text",
"title": "Orange",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_ORANGE"
}, {
"content_type": "text",
"title": "Pink",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_PINK"
}, {
"content_type": "text",
"title": "Brown",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_BROWN"
}, {
"content_type": "text",
"title": "Blue",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_BLUE"
}, {
"content_type": "text",
"title": "Black",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_BLACK"
}, {
"content_type": "text",
"title": "Magenta",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_BLACK"
}, {
"content_type": "text",
"title": "Voilate",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_VOILATE"
}],
"type": "conversation"
}
}
},
"destination": [{
"psid":["1207588322640336"]
}]
}
{
"appid": "",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"text": "Customer id check 1",
"quick_replies": [{
"content_type": "text",
"title": "Red",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED",
"image_url": "http://www.gstatic.com/webp/gallery/1.jpg"
}, {
"content_type": "text",
"title": "Green",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_GREEN",
"image_url": "https://www.gstatic.com/webp/gallery3/1.png"
}, {
"content_type": "text",
"title": "Yellow",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_YELLOW",
"image_url": "https://www.gstatic.com/webp/gallery3/1.png"
}, {
"content_type": "text",
"title": "Orange",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_ORANGE",
"image_url": "https://www.gstatic.com/webp/gallery3/1.png"
}, {
"content_type": "text",
"title": "Pink",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_PINK",
"image_url": "https://www.gstatic.com/webp/gallery3/1.png"
}, {
"content_type": "text",
"title": "Brown",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_BROWN",
"image_url": "https://www.gstatic.com/webp/gallery3/1.png"
}, {
"content_type": "text",
"title": "Blue",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_BLUE",
"image_url": "https://www.gstatic.com/webp/gallery3/1.png"
}, {
"content_type": "text",
"title": "Voilate",
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_VOILATE",
"image_url": "https://www.gstatic.com/webp/gallery3/1.png"
}],
"type": "conversation"
}
}
},
"destination": [{
"psid":["1207588322640336"]
}]
}
Facebook - Attachment
Specifies the attachment type.
Parameter | Type | Mandatory | Description |
---|---|---|---|
type | String | Yes | Specifies the type of the attachment. The options are:
|
payload | JSONObject | Yes | Specifies the payload of attachment. The parameters of payload are:
|
{
"appid": "",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"attachment": {
"type": "image",
"payload": {
"url": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcR5LtraajVrX9XqOtN9nhyFG9i9aJhhKcFG4LLZuw34ognS6zXQWkwOnILR"
}
}
}
}
},
"destination": [{
"psid":["1207588322640336"]
}]
}
{
"appid": "",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"attachment": {
"type": "audio",
"payload": {
"url": "http://www.stephaniequinn.com/Music/Pachelbel%20-%20Canon%20in%20D%20Major.mp3"
}
}
}
}
},
"destination": [{
"psid":["1207588322640336"]
}]
}
{
"appid": "",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"attachment": {
"type": "video",
"payload": {
"url": "http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4"
}
}
}
}
},
"destination": [{
"psid":["1207588322640336"]
}]
}
{
"appid": "",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"attachment": {
"type": "file",
"payload": {
"url": "http://www.pdf995.com/samples/pdf.pdf"
}
}
}
}
},
"destination": [{
"psid":["1207588322640336"]
}]
}
Facebook - Generic Template
Generic template allows you to send horizontal scrollable set of images with an option to configure short description and buttons to request input from the users. You can add up to 10 images per message. For more information on generic template, click here.
The parameters of generic template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
title | String | Yes | Specifies the bubble title. It has a limit of 80 characters. |
item_url | String | No | Specifies the URL that is opened when bubble is tapped. |
image_url | String | No | Specifies the bubble image. |
subtitle | String | No | Specifies the bubble subtitle. It has a limit of 80 characters. |
buttons | JSONArray | No | Specifies a set of buttons that appears as call-to-actions. You can add up to 3 buttons only. The parameters are:
|
{
"appid": "",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [{
"title": "Classic White T-Shirt",
"image_url": "http://petersapparel.parseapp.com/img/item100-thumb.png",
"subtitle": "Soft white cotton t-shirt is back in style",
"buttons": [{
"type": "web_url",
"url": "https://petersapparel.parseapp.com/view_item?item_id=100",
"title": "View Item"
}, {
"type": "web_url",
"url": "https://petersapparel.parseapp.com/buy_item?item_id=100",
"title": "Buy Item"
}, {
"type": "postback",
"title": "Bookmark Item",
"payload": "check"
}]
},
{
"title": "Giordano 60058 Black/Orange Analog Watch - For Men",
"image_url": "http://img6a.flixcart.com/image/watch/g/q/z/60058-black-orange-giordano-400x400-imae7c8rhnp4rfze.jpeg",
"subtitle": "Watch Watch",
"buttons": [{
"type": "web_url",
"url": "http://www.flipkart.com/giordano-60058-black-orange-analog-watch-men/p/itmdw4v6gkgejetj?pid=WATDW4V5GYEYQGQZ&al=rWnbPKcgb3ESJptH0q72XsldugMWZuE7Phn6Yd2VMSLMQz8fzEH13Ce0tGaT7ePiWmFmBeJJs7Q%3D&offer=nb%3Amp%3A0405c80713&ref=L%3A-7770517350658453810&srno=b_1",
"title": "View Item"
}, {
"type": "web_url",
"url": "https://petersapparel.parseapp.com/buy_item?item_id=101",
"title": "Buy Item"
}, {
"type": "postback",
"title": "Bookmark Item",
"payload": "USER_DEFINED_PAYLOAD_FOR_ITEM101"
}]
}]
}
}
}
}
},
"destination": [{
"psid": ["1207588322640336"]
}]
}
Facebook Buttons
Specifies a set of buttons that appears as call-to-actions. You can add up to 3 buttons only. The parameters are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
type | String | Yes | Specifies the value for button. The options are:
|
title | String | Yes | Specifies the button title. |
url | String | Yes | Specifies the web_url for buttons. It opens a browser when the button is tapped. |
payload | String | Yes | When the postback button is clicked an event is raised that can be used to write rules. |
Facebook - Button Template
Button template allows you to send a text and buttons attachment to request input from the user. The buttons can open a URL or make a back-end call to your webhook. For more information on button template, click here.
The parameters of button template are:
Parameter | Type | Mandatory | |
---|---|---|---|
text | String | Yes | The text that appears in the main body. |
buttons | JSONArray | No | Specifies a set of buttons that appears as call-to-actions. Click here to view the button object. |
{
"appid": "",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"attachment": {
"type": "template",
"payload": {
"template_type": "button",
"text": "Do you want to Play football",
"buttons": [
{
"type": "web_url",
"url": "https://www.google.co.in/maps/@17.4495157,78.4000172,16z?hl=en",
"title": "Show location"
}, {
"type": "postback",
"title": "Start Chatting",
"payload": "1232"
}, {
"type": "phone_number",
"title": "Call Representative",
"payload": "+917767984884"
}]
}
}
}
}
},
"destination": [{
"psid":["1207588322640336"]
}]
}
Facebook - Receipt Template
Receipt template allows you to send order confirmation, with the transaction summary and description for each item. For more information on receipt template, click here.
The parameters of receipt template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
recipient_name | String | Yes | Specifies the recipients name. |
order_number | String | Yes | specifies the order number. |
currency | String | Yes | Specifies the currency for order. |
payment_method | String | Yes | Specifies the payment method details. |
timestamp | String | No | Specifies the timestamp of order. It must be a unique number. |
order_url | String | No | Specifies the URL of order. |
JSONArray | Yes | Specifies the details of the order. The parameters are:
| |
JSONObject | No | Specifies the details of the shipping address. The parameters are:
| |
JSONObject | Yes | Specifies the payment summary details. The parameters are:
| |
JSONArray | No | Specifies the payment adjustments. The parameters are:
|
{
"appid": "",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"attachment": {
"type": "template",
"payload": {
"template_type": "receipt",
"recipient_name": "Stephane Crozatier",
"order_number": "1234444415678902",
"currency": "USD",
"payment_method": "Visa 2345",
"order_url": "http://petersapparel.parseapp.com/order?order_id=123456",
"timestamp": "1428444852",
"elements": [ {
"title": "Classic White T-Shirt",
"subtitle": "100% Soft and Luxurious Cotton",
"quantity": 2,
"price": 50,
"currency": "USD",
"image_url": "http://petersapparel.parseapp.com/img/whiteshirt.png"
}, {
"title": "Classic Gray T-Shirt",
"subtitle": "100% Soft and Luxurious Cotton",
"quantity": 1,
"price": 25,
"currency": "USD",
"image_url": "http://petersapparel.parseapp.com/img/grayshirt.png"
}],
"address": {
"street_1": "1 Hacker Way",
"street_2": "",
"city": "Menlo Park",
"postal_code": "94025",
"state": "CA",
"country": "US"
},
"summary": {
"subtotal": 75.00,
"shipping_cost": 4.95,
"total_tax": 6.19,
"total_cost": 56.14
},
"adjustments": [{
"name": "New Customer Discount",
"amount": 20
}, {
"name": "$10 Off Coupon",
"amount": 10
}]
}
}
}
}
},
"destination": [{
"psid":["1207588322640336"]
}]
}
Facebook - Receipt Elements
Specifies the details of the order in receipt template. It accepts an array.
Parameter | Type | Mandatory | Description |
---|---|---|---|
title | String | Yes | Specifies the title of the item. |
subtitle | String | No | Specifies the sub title of item. |
quantity | Integer | No | Specifies the quantity of item. |
price | Double | No | Specifies the item price. |
currency | String | No | Specifies the currency of price. |
image_url | String | No | Specifies the image URL of item. |
Facebook - Receipt Address
Specifies the details of the shipping address.
Parameter | Type | Mandatory | Description |
---|---|---|---|
street_1 | String | Yes | Specifies the street address, line 1. |
street_2 | String | No | Specifies the street address, line 2. |
city | String | Yes | Specifies the city details. |
postal_code | String | Yes | Specifies the postal code. |
state | String | Yes | Specifies the state abbreviation of a country. |
country | String | Yes | Specifies the two letter abbreviation of a country. |
Facebook - Receipt Summary
Specifies the payment summary details. The parameters are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
subtotal | Number | No | Specifies the subtotal. |
shipping_cost | Number | No | Specifies the cost of shipping. |
total_tax | Number | No | Specifies the total tax. |
total_cost | Number | No | Specifies the total cost. |
Facebook - Receipt Adjustments
Specifies the payment adjustments. The parameters are:
Parameter | Type | Mandatory | Description | |
---|---|---|---|---|
name | String | No | Specifies the name of adjustment. | |
amount | Number | No | Specifies the adjusted amount. |
Facebook - Airline Itinerary Template
Airline itinerary template is used send airline itinerary and receipt. For more information on airline boarding pass template, click here.
The parameters of payload object are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
template_type | String | Yes | Specifies the template type. The value must be airline_itinerary. |
intro_message | String | Yes | Specifies the introduction message. |
locale | String | Yes | Specifies the two-letter language region code. For example, en_US. |
theme_color | String | No | Specifies the background color of the attachment. The format must be RGB hexadecimal string. The default value is #009ddc. |
pnr_number | String | Yes | Specifies the passenger name record number. |
passenger_info | JSONArray | Yes | Specifies an array of passenger information. Refer to passenger_info object. |
flight_info | JSONArray | Yes | Specifies the flight information. Refer to flight_info object. |
passenger_segment_info | JSONArray | Yes | Specifies the information unique to passenger or segment pair. Refer to passenger_segment_info object. |
price_info | JSONArray | No | Specifies the itemized price information. Refer to price_info object. |
base_price | Number | No | Specifies the base price amount. |
tax | Number | No | Specifies the tax amount. |
total_price | Number | Yes | Specifies the total price of the booking. |
currency | String | Yes | Specifies the currency code. For example, to display American dollars the code is USD. |
{
"appid": "",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"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",
"product_info": [{
"title": "Lounge",
"value": "Complimentary lounge access"
}, {
"title": "Baggage",
"value": "1 extra bag 50lbs"
}]
}, {
"segment_id": "s001",
"passenger_id": "p002",
"seat": "12B",
"seat_type": "Business",
"product_info": [{
"title": "Lounge",
"value": "Complimentary lounge access"
}, {
"title": "Baggage",
"value": "1 extra bag 50lbs"
}]
}, {
"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"
}
}
}
}
},
"destination": [{
"psid":["1207588322640336"]
}]
}
Click here to view the supported list of currencies.
Facebook - Airline Itinerary Template - Passenger_info
The parameters of passenger_info under Airline Itinerary template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
passenger_id | String | Yes | Specifies a unique passenger identification. |
ticket_number | String | No | Specifies the ticket number. |
name | String | Yes | Specifies the full name of the passenger. |
Facebook - Airline Itinerary Template - Flight_info
The parameters of flight_info under Airline Itinerary template are:
Parameter | Type | Mandatory | Decription |
---|---|---|---|
connection_id | String | Yes | Specifies a unique id within the ininerary to group segments of a connection together. |
segment_id | String | Yes | Specifies the segmentid of the _passenger_segment_info object. |
flight_number | String | Yes | Specifies the flight number. |
aircraft_type | String | No | Specifies the aircraft type. |
departure_airport | JSONObject | Yes | Specifies the departure airport. Refer to _airport _object. |
arrival_airport | JSONObject | Yes | Specifies the arrival airport. Refer to airport object. |
flight_airport | JSONObject | Yes | Specifies the schedule for the flight. Refer to _flight_schedule _object. |
travel_class | String | Yes | Specifies the travel class. |
Facebook - Airline Itinerary Template - Passenger_segment_info
The parameters of passenger_segment_info under Airline Itinerary template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
segment_id | String | Yes | Specifies a unique id within the itinerary to identify a flight segment. |
passenger_id | String | Yes | Specifies the passenger id of passenger_info object. |
seat | String | Yes | Specifies the seat number for the passenger. |
seat_type | String | Yes | Specifies the seat type for the passenger. For example, Economy comfort. |
product_info | String | Yes | Specifies the list of products the passenger purchased. You can add up to 4 products only. |
Facebook - Airline Itinerary Template - Airport
The parameters of airport object under Airline Itinerary template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
airport_code | String | Yes | Specifies the airport code. |
city | String | Yes | Specifies the city name. |
terminal | String | No | Specifies the terminal number. |
gate | String | No | Specifies the gate number. |
Facebook - Airline Itinerary Template - Flight_schedule
The parameters of flight_schedule object under Airline Itinerary template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
boarding_time | String | No | Specifies the boarding time in departure airport timezone. |
departure_time | String | Yes | Specifies the departure time in departure airport timezone. |
arrival_time | String | Yes | Specifies the arrival time in arrival airport timezone. |
The timezone format must be in ISO 8601-based format YYYY-MM-DDThh:mm. For example, 2016-09-26T11:15.
Facebook - Airline Itinerary Template - price_info
The parameters of price_info object under Airline Itinerary template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
title | String | Yes | Specifies the product title |
value | String | Yes | Specifies the product description. |
Facebook - Airline Checkin Template
Airline checkin template is used to send flight checkin reminder message. For more information on airline checkin template, click here.
The parameters payload object are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
template_type | String | Yes | Specifies the template type. The value must be airline_itinerary. |
intro_message | String | Yes | Specifies the introduction message. |
locale | String | Yes | Specifies the two-letter language region code. For example, en_US. |
theme_color | String | No | Specifies the background color of the attachment. The format must be RGB hexadecimal string. The default value is #009ddc. |
pnr_number | String | Yes | Specifies the passenger name record number. |
flight_info | JSONArray | Yes | Specifies the flight information. Refer to flight_info object. |
checkin_url | String | Yes | Specifies the URL for passengers to check-in. |
{
"appid": "",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"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"
}
}
}
}
},
"destination": [{
"psid":["1207588322640336"]
}]
}
Facebook - Airline Checkin Template - Flight_Info
The parameters of flight_info under Airline Checkin template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
flight_number | String | Yes | Specifies the flight number. |
departure_airport | JSONObject | Yes | Specifies the departure airport. |
arrival_airport | JSONObject | Yes | Specifies the arrival airport. |
flight_schedule | JSONObject | Yes | Specifies the schedule for the flight. |
Facebook - Airline Checkin Template - Flight_schedule
The parameters of flight_schedule object under Airline Checkin template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
boarding_time | String | No | Specifies the boarding time in departure airport timezone. |
departure_time | String | Yes | Specifies the departure time in departure airport timezone. |
arrival_time | String | Yes | Specifies the arrival time in arrival airport timezone. |
The timezone format must be in ISO 8601-based format YYYY-MM-DDThh:mm. For example, 2016-09-26T11:15.
Facebook - Airline Boarding Pass Template
Airline boarding pass template allows you to send boarding passes for one or more flights to passengers. For more information on airline boarding pass template, click here.
The parameters of payload object under Airline Boarding Pass template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
template_type | String | Yes | Specifies the template type. The value must be airline_itinerary. |
intro_message | String | Yes | Specifies the introduction message. |
locale | String | Yes | Specifies the two-letter language region code. For example, en_US. |
theme_color | String | No | Specifies the background color of the attachment. The format must be RGB hexadecimal string. The default value is #009ddc. |
boarding_pass | JSONArray | Yes | Specifies the boarding passes for passengers. Refer to the boarding_pass object. |
{
"appid": "",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"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"
}
}
}]
}
}
}
}
},
"destination": [{
"psid":["1207588322640336"]
}]
}
Facebook - Airline Boarding Pass Template - Boarding_Pass
The parameters of boarding_pass object under Airline Boarding Pass template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
passenger_name | String | Yes | Specifies the passenger name. |
pnr_number | String | Yes | Specifies the passenger name record number. |
travel_class | String | No | Specifies the travel class.
|
seat | String | No | Specifies the seat number for the passenger. |
auxiliary_fields | JSONArray | No | Specifies the flexible information to display in the auxiliary section. You can add upto 5 fields. Refer to field object. |
secondary_fields | JSONArray | No | Specifies the flexible information to display in the secondary section. You can add upto 5 fields. Refer to field object. |
logo_image_url | String | Yes | Specifies the URL for the logo image. |
header_image_url | String | No | Specifies the URL for the header image. |
header_text_field | String | No | Specifies the text for the header field. |
qr_code | String | Yes, unless the image of barcode is provided. | Specifies Aztec or QR code. |
barcode_image_url | String | Yes, unless the qr_code is provided. | Specifies the URL of the barcode image. |
above_bar_code_image_url | String | Yes | Specifies the URL of thin image above the barcode. |
flight_info | JSONObject | Yes | Specifies the information about the flight. Refer to flight_info object. |
Facebook - Airline Boarding Pass Template - Flight_info
The parameters of flight_info under Airline Boarding Pass template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
flight_number | String | Yes | Specifies the flight number. |
departure_airport | JSONObject | Yes | Specifies the departure airport. Refer to _airport _object. |
arrival_airport | JSONObject | Yes | Specifies the arrival airport. Refer to airport object. |
flight_schedule | JSONObject | Yes | Specifies the schedule for the flight. Refer to _flight_schedule _object. |
Facebook - Airline Boarding Pass Template - Flight_schedule
The parameters of flight_schedule object under Airline Boarding Pass template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
boarding_time | String | No | Specifies the boarding time in departure airport timezone. |
departure_time | String | Yes | Specifies the departure time in departure airport timezone. |
arrival_time | String | No | Specifies the arrival time in arrival airport timezone. |
The timezone format must be in ISO 8601-based format YYYY-MM-DDThh:mm. For example, 2016-09-26T11:15.
Facebook - Airline Boarding Pass Template - Flight_info - Airport
The parameters of airport object under Airline Boarding Pass template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
airport_code | String | Yes | Specifies the airport code. |
city | String | Yes | Specifies the city name. |
terminal | String | No | Specifies the terminal number. |
gate | String | No | Specifies the gate number. |
The timezone format must be in ISO 8601-based format YYYY-MM-DDThh:mm. For example, 2016-09-26T11:15.
Facebook - Airline Boarding Pass Template - Field
The parameters of field object under Airline Boarding Pass template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
label | String | Yes | Specifies the label for the additional field. |
value | String | Yes | Specifies the value for the additional field. |
Facebook - Airline Flight Update Template
Airline flight update template allows you to send flight status update message. For more information on airline flight update template, click here.
The parameters payload object are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
template_type | String | Yes | Specifies the template type. The value must be airline_update. |
intro_message | String | No | Specifies the introduction message. |
update_type | String | Yes | Specifies the type of update for the notification. The options are:
|
locale | String | Yes | Specifies the two-letter language region code. For example, en_US. |
theme_color | String | No | Specifies the background color of the attachment. The format must be RGB hexadecimal string. The default value is #009ddc. |
pnr_number | String | Yes | Specifies the passenger name record number. |
update_flight_info | JSONObject | Yes | Specifies the information about a flight. Refer to update_flight_info object. |
{
"appid":"<your_app_id>",
"notifyurl": "",
"deliverychannel": "fb",
"channels": {
"OTT-Messaging": {
"fb": {
"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"
}
}
}
}
}
}
},
"destination": [{
"psid":["1207588322640336"]
}]
}
Facebook - Airline Flight Update Template - Update_flight_info
The parameters of update_flight_info under Airline Flight Update template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
flight_number | String | Yes | Specifies the flight number. |
departure_airport | JSONObject | Yes | Specifies the departure airport. Refer to airport object. |
arrival_airport | JSONObject | Yes | Specifies the arrival airport. Refer to airport object. |
flight_schedule | JSONObject | Yes | Specifies the schedule for the flight. Refer to flight_schedule object. |
Facebook - Airline Flight Update Template - Update_Flight_info - Flight_schedule
The parameters of flight_schedule under Airline Flight Update template are:
Parameter | Type | Mandatory | Description |
---|---|---|---|
boarding_time | String | No | Specifies the boarding time in departure airport timezone. |
departure_time | String | Yes | Specifies the departure time in departure airport timezone. |
arrival_time | String | No | Specifies the arrival time in arrival airport timezone. |
The timezone format must be in ISO 8601-based format YYYY-MM-DDThh:mm. For example, 2016-09-26T11:15.
smartlinks
An array that contains the parameters of Smartlink. This is an optional parameter. To use Smartlinks, you must create a smartlink and use the link id in messaging API. These smartlinks can be used in SMS, RT and OTT messaging channels.
Following are the parameters of smartlinks:
Parameter | Type | Mandatory | Description |
---|---|---|---|
linkid | Number | Yes | This parameter is mandatory when the smartlinks parameter is configured. The linkid gets generated for a smartlink created using IMIconnect. |
validity | Number | No | Specifies the time in minutes after which the link will expire. |
{
"smartlinks":[
{
"linkid": "<specifies the link id that is generated for a Smartlink using IMIconnect. >",
"validity": "<Specifies the time in minutes after which the link will expire>"
}
]
}