Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any Way Around Facebook Bots Button Template Limit?

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"
          }
        ]
      }
    }
  }
}
like image 505
nickbona Avatar asked Jun 16 '16 01:06

nickbona


People also ask

Are bots allowed on Facebook?

As of yesterday, Facebook is no longer allowing new bots on their platform. According to Facebook, this halt on bots (and Facebook apps in general) is supposed to only last a few weeks while they complete their internal audits.

Does Facebook Messenger have a character limit?

Facebook Messenger messages are limited to about 20,000 characters.


2 Answers

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.

like image 182
Mukarram Khalid Avatar answered Sep 20 '22 19:09

Mukarram Khalid


You can also use the "Quick Replies" : https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies

Quick replies allows you to display up to 11 options in buttons in a single row :

facebook quick replies

like image 40
raphael Avatar answered Sep 21 '22 19:09

raphael