Ice Breakers

Ice Breakers provide a way for users to start a conversation with a business with a list of frequently asked questions. A maximum of 4 questions can be set via the Ice Breaker API.

Setting Ice Breakers

curl -X POST -H "Content-Type: application/json" -d '{
  "platform": "instagram",
  "ice_breakers":[
     {
        "question": "<QUESTION>",
        "payload": "<PAYLOAD>"
     },
     {
        "question": "<QUESTION>",
        "payload": "<PAYLOAD>"
     },
     ...
      
  ]
}' "https://graph.facebook.com/v8.0/me/messenger_profile?access_token=<PAGE_ACCESS_TOKEN>"

Getting Ice Breakers

curl -X GET "https://graph.facebook.com/v8.0/me/messenger_profile?fields=ice_breakers&platform=instagram&access_token=<PAGE_ACCESS_TOKEN>"

Response

{
   "data": [
        {
          "ice_breakers": [
            {
                "question": "<QUESTION>",
                "payload": "<PAYLOAD>",
            },
            ...
        ]
      }
   ]
}

Deleting Icebreakers

curl -X DELETE -H "Content-Type: application/json" -d '{
  "fields": [
    "ice_breakers",
  ]
}' "https://graph.facebook.com/v8.0/me/messenger_profile?platform=instagram&access_token=%lt;PAGE_ACCESS_TOKEN>"

Webhook Event

In order to receive postback webhooks from Icebreakers, the app needs to be subscribed to messaging_postbacks v8.0+ webhook under Instagram topic on the app settings.

The webhook will receive a json payload similar to the example below.

{
  "object": "instagram",
  "entry": [
    {
      "id": "<IGSID>",
      "time": 1502905976963,
      "messaging": [
        {
          "sender": {
            "id": "<IGSID>"
          },
          "recipient": {
            "id": "<IGID>"
          },
          "timestamp": 1502905976377,
          "postback": {
            "title": "<SELECTED_ICEBREAKER_QUESTION>",
            "payload": "<USER_DEFINED_PAYLOAD>",
          }
        }
      ]
    }
  ]
}