How to make test users work with Facebook Messenger Bots

It’s not massively easy, and it’s definitely not clear. But you CAN have test users for your Messenger bot. Here’s how!

It’s no secret that I have built my own personal Messenger “bot” for school information called SchoolBot.

But at some point I’d love for it to be more public, to get people to test it, to get some feedback from more normal people than I to see if it’s really, actually useful, or just a toy for me to play with.

So I created a test instance for “Springfield Elementary” with the aim of allowing others to try it out.

I don’t want to make this thing public to everyone – but I do want people to be able to find it and give controlled access to it to test it out. But HOW does this work?

The way that Facebook Messenger bots use apps and pages and which users are allowed to use which things when you’re in test/development mode is REALLY confusing. But I think I’ve figured it out.

The component parts

I‘m building SchoolBot with BotMan – a Laravel-based chatbot framework. This forms the ultimate back-end for the bot.

At the “front end” of this system is a page that you message through Facebook Messenger.

And a Facebook App connects the page to the BotMan back-end, passing messages between the two.

Private, published, dev, live and all the roles!

The two Facebook components – the app and the page – both have a status. The page can be Published or Unpublished. The app can be in development mode, or live mode.

Development Apps vs Live Apps

Development apps are only usable by those users that have been added with an app role.

To allow anyone to use your app you need to make the app live. To get your app live can be quite tricky as you may need to submit it for review, and this requires all sorts of things like privacy policies and maybe organisational verification. (This is a GOOD thing! It prevents random apps stealing all your data!!)

So if you want to just do some testing before you apply for review, or if you’re waiting to go through the review process you’ll be stuck in development mode.

Published vs Unpublished pages

Unpublished pages won’t be found in search and can only be seen by and interacted with by those users that have been added with a page role.

Page roles

A published page can be searched for and discovered by anyone. But an unpublished page can only be seen and used by people who have a Page Role.

Page Roles are a bit annoying because there isn’t a role that lets someone just see and use an unpublished page. The lowest level is “Analyst” which “Can see which admin created a post or comment and view Insights.”

App Roles

App Roles are better because you can actually give people a “Tester” role. BUT…App Roles are annoying for test users because they have to use the developer.facebook.com developer portal to accept their role and the whole thing is a bit scary if they’ve not seen it before.

Putting it together

So I have my Page which talks to my BotMan through my App. I’ve connected them all together (this is a whole other post worth of stuff) and now I’m wanting to bring in some people to test it the Messenger bot. What do we have to do?:

  • The Page can be published or unpublished. Just bear in mind that it’s harder for people to find if it’s unpublished – you’ll probably have to send them a link.
  • IF the Page is unpublished then the test users will need to be added with a Page Role, the lowest of which is “Analyst”. And then you’ll have to send them the link to the page too because it won’t be found in search.

They should then be able to Message the page once you set up a “Send Message” button on the page. But their message won’t get to the Bot because they aren’t allowed to use the app part that relays the message. So…

  • You need to go to the developer portal and add them as a “Tester”. This will send them an invite but they’ll need to log in to the developer portal themselves to accept it.

Done!

With that all done, the person should be able to send a message to the page, have it relayed to the bot by the app, and the have the responses relayed back too.

It’s not massively easy, and it’s definitely not clear. But you CAN have test users for your Messenger bot in this way.

YAY!