Step-by-Step Guide To Building Facebook Messenger Bots

Bots may be the big new trend, but that does not mean they are necessarily all that sophisticated.

Neural networks and artificial intelligence notwithstanding.

Bots, at their core, are basically interaction engines. Apps are also essentially interaction engines. The difference between the two is the primary mode of interaction: natural language and speech for bots, touch and swipe for apps.

It stands to reason then that the simple bots are not all that difficult to build. After all, the development of bots is not all that different from the backend processes of an app or website … just without all that tricky design and user experience work.

For instance, take a look at the new Facebook Messenger Platform bots. The basic tools are objects that developers will well recognize: send and receive APIs, webhooks and plugins. Tie all these items into the bot template and backend services and you have a fairly functional bot.

How To Get Started Building Facebook Messenger Platform Bots

Bots for Messenger Platform are easy enough to create that Facebook engineers were able to give a working example of simple bots in about 10 minutes during the F8 developer conference this week in San Francisco.

The general steps a developer needs to follow to start building a bot include:

  1. Create a Facebook app and a Facebook Page
  2. Setup the webhooks
  3. Generate the page access token
  4. Subscribe back to the Page and app
  5. Receive messages from the webhook
  6. Send a text message
  7. Send rich and/or structured data
  8. Handle postbacks interactions from the user

For more detail, follow specific instructions from the Facebook Developer Portal.

Essentially, the bot is operating on a fairly standard webook/postback model that has been in use for apps and websites for more than a decade. The setup of the webhook with a Facebook verified token and then tie it back to the Facebook App and Page.

If you have ever built a webhook for a Facebook App, the process for building one for a bot is no different. The same Facebook webhook subscription with a valid URL callback endpoint process with a verified token is the same from a Facebook App. Instead of an app, the webhook is being set up with the Facebook Messenger Platform bot. You can read all about the specifics in how to integrate Facebook webhooks here.

Once the internal messaging system for the bot is set up with the webhook, text capabilities and postbacks, Facebook has some standard templates for developers to use to build simple bots. For ecommerce bots like Spring or 1-800-Flowers, the bot will respond to text commands from the user and bring up a carousel of products to swipe through with a dropdown call-to-action menu. More conversational bots can be set up through a CMS and the developer can choose the interaction flow, like how long it takes a bot to respond to a query (the Poncho weather cat takes a few seconds to respond, as if it is typing).

For entry points and discovery, Facebook has two primary plugins for Messenger that tie to the specific user ID of the bot. The “Message Us” and “Send-to-Messenger” plugins are buttons for bringing and authenticating users from the Web and apps to Messenger.

After the webhooks and custom user interface has been done and the bot is functional, developers submit the bot to Facebook for approval. Make sure to read the Facebook Messenger Platform policy and guidelines and the review process from Facebook.

The AI Behind The Bots

One of the bigger aspects of the Facebook Messenger Platform is the ability for developers to add natural language recognition and response to bots. Facebook achieves this by letting developers plug in to its simple AI platform and dashboard through

To build natural language capabilities in to a Facebook Messenger bot, developers will need to login to and use the console to build conversations from there. The console is fairly easy to use and its API sends the text conversation back to the bot in Facebook Messenger.

The way works is that a developer sets up some parameters for what questions it might be asked and what answers it will give. A traffic bot will want to know the location of the users and where they want to go. will then plugin those various data points, fetch the data and then offer a response based on the user’s query. is not exactly the most sophisticated artificial intelligence and it looks a lot like a natural language engine built on top of an API search and management solution like But for the purposes of bot management, it is simple and intuitive and will grow as it learns new queries and parameters in the future.

Want to see more like this?
Dan Rowinski
Former ARC Editor-in-Chief at Applause
Reading time: 5 min

How to Assess Testing Resource Allocation

If you can’t measure the value of your efforts, you can’t explain or even justify your testing investment

Using Questionable Datasets to Train AI Could Come With High Costs

As companies look to capitalize on AI development, they must stay mindful of how they source training data — AI algorithms developed from private or non-consensual data may cost businesses in the long run.

Why Payment Testing is a Constant for Media Companies

Simulated transactions and pre-production testing won’t ensure friction-free subscriber payment flows

How Mobile Network Operators Can Leverage e- and iSIMs

We explain what e- and iSIMs are, what they mean for the industry and how MNOs and MVNOs can leverage them to their advantage.

Jumpstart Your Software Testing Education

Testers have a variety of options to upskill and grow professionally

The Future of Generative AI: An Interview with ChatGPT

We ask ChatGPT about where it sees itself in the future, what needs to happen for it to get there and how Applause can help.