Headers

Request HeaderDescription
keyService Key
content-typeapplication/json

Response

This API may return the following response codes:

Response CodeMessageDescription
1001QueuedReturned when the request is accepted by IMIconnect.
7000Invalid JSONReturned when an invalid JSON request is sent.
7001Authentication failedReturned when an invalid service key or profile key is provided in the request.
7002Service key missingReturned when the parameter key is missing in the message request.
7003Mandatory parameters missingReturned when the mandatory parameters configured in custom event are missing.
7004Invalid parametersReturned when the parameters are invalid.
7006Internal error occurredReturned when an internal error occurs.
7007Service inactiveReturned when the service is in inactive state.
7009Max number of destinationsReturned when an API request exceeds the limit (1000) to send messages using messaging API.
##Request Body
{  
   "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:

  • type

  • payload

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:

  • REGULAR (Default): The notification will be sent with a sound.

  • SILENT_PUSH: the notification will be sent silently. The notification will be received without any sound.

  • NO_PUSH: The notification will not be sent.

sender_action

String

Yes

Specifies the message state. The options are:

  • mark_seen

  • typing_on

  • typing_off

Note: Either text _or _attachment or sender_action is mandatory.

quick_repliesJSONArrayNoSpecifies 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:

  • text

  • location

titleStringYes. This is applicable only when content_type is set as text.Specifies the caption for button. You can add upto 20 characters as title.
payloadStringYes. 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_urlStringNoSpecifies 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:

  • image

  • audio

  • video

  • file

  • template

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:

  • type

  • title

  • url

  • payload

{
    "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:

  • web_url

  • postback

titleStringYesSpecifies the button title.
urlStringYesSpecifies the web_url for buttons. It opens a browser when the button is tapped.
payloadStringYesWhen 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:

ParameterTypeMandatory
textStringYesThe text that appears in the main body.
buttonsJSONArrayNoSpecifies 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.

elements

JSONArray

Yes

Specifies the details of the order. The parameters are:

  • title

  • subtitle

  • quantity

  • price

  • currency

  • image_url

address

JSONObject

No

Specifies the details of the shipping address. The parameters are:

  • street_1

  • street_2

  • city

  • postal_code

summary

JSONObject

Yes

Specifies the payment summary details. The parameters are:

  • subtotal

  • shipping_cost

  • total_tax

adjustments

JSONArray

No

Specifies the payment adjustments. The parameters are:

  • name

  • amount

{
    "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.

ParameterTypeMandatoryDescription
titleStringYesSpecifies the title of the item.
subtitleStringNoSpecifies the sub title of item.
quantityIntegerNoSpecifies the quantity of item.
priceDoubleNoSpecifies the item price.
currencyStringNoSpecifies the currency of price.
image_urlStringNoSpecifies the image URL of item.
Facebook - Receipt Address

Specifies the details of the shipping address.

ParameterTypeMandatoryDescription
street_1StringYesSpecifies the street address, line 1.
street_2StringNoSpecifies the street address, line 2.
cityStringYesSpecifies the city details.
postal_codeStringYesSpecifies the postal code.
stateStringYesSpecifies the state abbreviation of a country.
countryStringYesSpecifies the two letter abbreviation of a country.
Facebook - Receipt Summary

Specifies the payment summary details. The parameters are:

ParameterTypeMandatoryDescription
subtotalNumberNoSpecifies the subtotal.
shipping_costNumberNoSpecifies the cost of shipping.
total_taxNumberNoSpecifies the total tax.
total_costNumberNoSpecifies the total cost.
Facebook - Receipt Adjustments

Specifies the payment adjustments. The parameters are:

ParameterTypeMandatoryDescription
nameStringNoSpecifies the name of adjustment.
amountNumberNoSpecifies 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:

ParameterTypeMandatoryDescription
template_typeStringYesSpecifies the template type. The value must be airline_itinerary.
intro_messageStringYesSpecifies the introduction message.
localeStringYesSpecifies the two-letter language region code. For example, en_US.
theme_colorStringNoSpecifies the background color of the attachment. The format must be RGB hexadecimal string. The default value is #009ddc.
pnr_numberStringYesSpecifies the passenger name record number.
passenger_infoJSONArrayYesSpecifies an array of passenger information. Refer to passenger_info object.
flight_infoJSONArrayYesSpecifies the flight information. Refer to flight_info object.
passenger_segment_infoJSONArrayYesSpecifies the information unique to passenger or segment pair. Refer to passenger_segment_info object.
price_infoJSONArrayNoSpecifies the itemized price information. Refer to price_info object.
base_priceNumberNoSpecifies the base price amount.
taxNumberNoSpecifies the tax amount.
total_priceNumberYesSpecifies the total price of the booking.
currencyStringYesSpecifies 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:

ParameterTypeMandatoryDescription
passenger_idStringYesSpecifies a unique passenger identification.
ticket_numberStringNoSpecifies the ticket number.
nameStringYesSpecifies the full name of the passenger.
Facebook - Airline Itinerary Template - Flight_info

The parameters of flight_info under Airline Itinerary template are:

ParameterTypeMandatoryDecription
connection_idStringYesSpecifies a unique id within the ininerary to group segments of a connection together.
segment_idStringYesSpecifies the segmentid of the _passenger_segment_info object.
flight_numberStringYesSpecifies the flight number.
aircraft_typeStringNoSpecifies the aircraft type.
departure_airportJSONObjectYesSpecifies the departure airport. Refer to _airport _object.
arrival_airportJSONObjectYesSpecifies the arrival airport. Refer to airport object.
flight_airportJSONObjectYesSpecifies the schedule for the flight. Refer to _flight_schedule _object.
travel_classStringYesSpecifies the travel class.
Facebook - Airline Itinerary Template - Passenger_segment_info

The parameters of passenger_segment_info under Airline Itinerary template are:

ParameterTypeMandatoryDescription
segment_idStringYesSpecifies a unique id within the itinerary to identify a flight segment.
passenger_idStringYesSpecifies the passenger id of passenger_info object.
seatStringYesSpecifies the seat number for the passenger.
seat_typeStringYesSpecifies the seat type for the passenger. For example, Economy comfort.
product_infoStringYesSpecifies 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:

ParameterTypeMandatoryDescription
airport_codeStringYesSpecifies the airport code.
cityStringYesSpecifies the city name.
terminalStringNoSpecifies the terminal number.
gateStringNoSpecifies the gate number.
Facebook - Airline Itinerary Template - Flight_schedule

The parameters of flight_schedule object under Airline Itinerary template are:

ParameterTypeMandatoryDescription
boarding_timeStringNoSpecifies the boarding time in departure airport timezone.
departure_timeStringYesSpecifies the departure time in departure airport timezone.
arrival_timeStringYesSpecifies 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:

ParameterTypeMandatoryDescription
titleStringYesSpecifies the product title
valueStringYesSpecifies 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:

ParameterTypeMandatoryDescription
template_typeStringYesSpecifies the template type. The value must be airline_itinerary.
intro_messageStringYesSpecifies the introduction message.
localeStringYesSpecifies the two-letter language region code. For example, en_US.
theme_colorStringNoSpecifies the background color of the attachment. The format must be RGB hexadecimal string. The default value is #009ddc.
pnr_numberStringYesSpecifies the passenger name record number.
flight_infoJSONArrayYesSpecifies the flight information. Refer to flight_info object.
checkin_urlStringYesSpecifies 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:

ParameterTypeMandatoryDescription
flight_numberStringYesSpecifies the flight number.
departure_airportJSONObjectYesSpecifies the departure airport.
arrival_airportJSONObjectYesSpecifies the arrival airport.
flight_scheduleJSONObjectYesSpecifies the schedule for the flight.
Facebook - Airline Checkin Template - Flight_schedule

The parameters of flight_schedule object under Airline Checkin template are:

ParameterTypeMandatoryDescription
boarding_timeStringNoSpecifies the boarding time in departure airport timezone.
departure_timeStringYesSpecifies the departure time in departure airport timezone.
arrival_timeStringYesSpecifies 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:

ParameterTypeMandatoryDescription
template_typeStringYesSpecifies the template type. The value must be airline_itinerary.
intro_messageStringYesSpecifies the introduction message.
localeStringYesSpecifies the two-letter language region code. For example, en_US.
theme_colorStringNoSpecifies the background color of the attachment. The format must be RGB hexadecimal string. The default value is #009ddc.
boarding_passJSONArrayYesSpecifies 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.
The options are:

  • economy

  • business

  • first_class

seatStringNoSpecifies the seat number for the passenger.
auxiliary_fieldsJSONArrayNoSpecifies the flexible information to display in the auxiliary section. You can add upto 5 fields. Refer to field object.
secondary_fieldsJSONArrayNoSpecifies the flexible information to display in the secondary section. You can add upto 5 fields. Refer to field object.
logo_image_urlStringYesSpecifies the URL for the logo image.
header_image_urlStringNoSpecifies the URL for the header image.
header_text_fieldStringNoSpecifies the text for the header field.
qr_codeStringYes, unless the image of barcode is provided.Specifies Aztec or QR code.
barcode_image_urlStringYes, unless the qr_code is provided.Specifies the URL of the barcode image.
above_bar_code_image_urlStringYesSpecifies the URL of thin image above the barcode.
flight_infoJSONObjectYesSpecifies 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:

ParameterTypeMandatoryDescription
flight_numberStringYesSpecifies the flight number.
departure_airportJSONObjectYesSpecifies the departure airport. Refer to _airport _object.
arrival_airportJSONObjectYesSpecifies the arrival airport. Refer to airport object.
flight_scheduleJSONObjectYesSpecifies 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:

ParameterTypeMandatoryDescription
boarding_timeStringNoSpecifies the boarding time in departure airport timezone.
departure_timeStringYesSpecifies the departure time in departure airport timezone.
arrival_timeStringNoSpecifies 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:

ParameterTypeMandatoryDescription
airport_codeStringYesSpecifies the airport code.
cityStringYesSpecifies the city name.
terminalStringNoSpecifies the terminal number.
gateStringNoSpecifies 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:

ParameterTypeMandatoryDescription
labelStringYesSpecifies the label for the additional field.
valueStringYesSpecifies 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:

  • delay

  • gate_change

  • cancellation

localeStringYesSpecifies the two-letter language region code. For example, en_US.
theme_colorStringNoSpecifies the background color of the attachment. The format must be RGB hexadecimal string. The default value is #009ddc.
pnr_numberStringYesSpecifies the passenger name record number.
update_flight_infoJSONObjectYesSpecifies 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:

ParameterTypeMandatoryDescription
flight_numberStringYesSpecifies the flight number.
departure_airportJSONObjectYesSpecifies the departure airport. Refer to airport object.
arrival_airportJSONObjectYesSpecifies the arrival airport. Refer to airport object.
flight_scheduleJSONObjectYesSpecifies 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:

ParameterTypeMandatoryDescription
boarding_timeStringNoSpecifies the boarding time in departure airport timezone.
departure_timeStringYesSpecifies the departure time in departure airport timezone.
arrival_timeStringNoSpecifies 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:

ParameterTypeMandatoryDescription
linkidNumberYesThis parameter is mandatory when the smartlinks parameter is configured. The linkid gets generated for a smartlink created using IMIconnect.
validityNumberNoSpecifies 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>"
        }
      ]
}
Language
Credentials
Header
Copyright © 2000 - 2021 IMImobile Limited | All Rights Reserved