OmelSoft

How to Add a Persistent Menu in Facebook Messenger Bot

Setting up a Persistent Menu in Messenger Bot can help businesses interact and engage with their audience effortlessly.

The persistent menu allows you to have an always-on user interface element inside Messenger conversations. This is an easy way to help people discover and access the core functionality of your Messenger bot at any point in the conversation.

There are several applications that offer the same feature. All you need to do is signup on their website using your Facebook profile and they will be able to see all the Facebook pages that you managed and link the pages you want to manage from their app.

Before you can add a persistent menu to your Facebook Messenger Bot, you need to Enable the “Get Started” button first.

Just like how we set up the “Get Started” button, the persistent menu setup is only a few steps away.

Installing the Persistent Menu

1. Open the Postman application and create a new “POST” request project.

2. Copy and paste the following in the Request URL field.

https://graph.facebook.com/v6.0/me/messenger_profile?access_token=**PAGE_ACCESS_TOKEN**

3. Set the “access_token” field using the Facebook Page Access Token.

Add a Persistent Menu Params

4. In the “Headers” section, set the “Content/Type” to “application/json“.

Add a Persistent Menu Headers

5. In the “Body” section, select “raw” format and copy and paste the following json. The following code will create 3 menu items such as (Help, Contact Us, and Visit Website).

{
    "persistent_menu": [
        {
            "locale": "default",
            "composer_input_disabled": false,
            "call_to_actions": [
                {
                    "type": "postback",
                    "title": "Help",
                    "payload": "HELP_PAYLOAD"
                },
                {
                    "type": "postback",
                    "title": "Contact Us",
                    "payload": "CONTACT_US_PAYLOAD"
                },
                {
                    "type": "web_url",
                    "title": "Visit Website",
                    "url": "https://www.omelsoft.com/",
                    "webview_height_ratio": "full"
                }
            ]
        }
    ]
}
Add a Persistent Menu Body

6. Finally, click the “Send” button to make the request. You will see the following result if the request is successful.

Postman New Request Response

To verify that everything worked as expected and to see the persistent menu in action. You have to delete any previous conversation you’ve created with the page and start again by searching for your Facebook bot in messenger.

Persistent Menu in Action

Add comment

E-mail is already registered on the site. Please use the Login form or enter another.

You entered an incorrect username or password

Sorry, you must be logged in to post a comment.