Any Way Around Facebook Bots Button Template Limit?

nickbona picture nickbona · Jun 16, 2016 · Viewed 12.5k times · Source

It appears (undocumented) that for a button message type in the Facebook Bots chat system, there is a max of 3 buttons. This seems arbitrary and limiting. Does anyone know if there is a way to have more than 3 buttons?

To be clear, I'm referring to the following message JSON:

{
  "recipient":{
    "id":"USER_ID"
  },
  "message":{
    "attachment":{
      "type":"template",
      "payload":{
        "template_type":"button",
        "text":"What do you want to do next?",
        "buttons":[
          {
            "type":"web_url",
            "url":"https://petersapparel.parseapp.com",
            "title":"Show Website"
          },
          {
            "type":"postback",
            "title":"Start Chatting",
            "payload":"USER_DEFINED_PAYLOAD"
          }
        ]
      }
    }
  }
}

Answer

Mukarram Khalid picture Mukarram Khalid · Jun 28, 2016

There's no way to bypass this limit. Facebook has clearly documented the limits of a generic template here:

Title: 80 characters

Subtitle: 80 characters

Call-to-action title: 20 characters

Call-to-action items: 3 buttons

Bubbles per message (horizontal scroll): 10 elements

There can be maximum 3 buttons in one bubble. you can add another bubble with 3 more buttons. For example:

{
  "recipient": {
    "id": "RECIPIENT_ID"
  },
  "message": {
    "attachment": {
      "type": "template",
      "payload": {
        "template_type": "generic",
        "elements": [
          {
            "title": "Swipe left/right for more options.",
            "buttons": [
              {
                "type": "postback",
                "title": "Button 1",
                "payload": "button1"
              },
              {
                "type": "postback",
                "title": "Button 2",
                "payload": "button2"
              },
              {
                "type": "postback",
                "title": "Button 3",
                "payload": "button3"
              }
            ]
          },
          {
            "title": "Swipe left/right for more options.",
            "buttons": [
              {
                "type": "postback",
                "title": "Button 4",
                "payload": "button4"
              },
              {
                "type": "postback",
                "title": "Button 5",
                "payload": "button5"
              },
              {
                "type": "postback",
                "title": "Button 6",
                "payload": "button6"
              }
            ]
          }
        ]
      }
    }
  }
}

You can add maximum 10 bubbles in one generic template.

OR

You can use quick replies.