Bradley Kieser
Bradley Kieser

Reputation: 1

How to test facebook chatbot with test user and test page

I have a chatbot that I want to test with test users on Facebook.

I have created a test app from the main app, per Facebook's recommendations. And in that I have created test users. Those account work and I can log into them.

To test a chatbot, you need to have a page that it's enabled on. So I have created a page in the test user account.

I can even see that chatbot app, correctly named, in the "Business Integrations" menu option.

I can also message the page from the test user account. However, those messages are never sent to the chatbot. There is zero traffic.

Using my real account, I can create a test page and link it to the very same test app for the chatbot and it works just fine. I can message that test page and the chatbot receives the message and processes it.

The difference is that on the app page, the "real world" test page shows up because I own it, so I can add it to the chatbot app. However as the test user is a separate user, the test user page doesn't show up in the options to add a page, only the pages that I own.

There is a menu option to log in as another user, but doing that as the test user gives the error that a test user cannot access the developer.facebook.com service. So no luck there.

So in short, it LOOKs like the test page is linked to the test chatbot app because it appears in "business integrations", but no traffic is routing.

Things changed in 2018 at Facebook. The old way of using Graph API to link your test page to your chatbot app no longer works. Facebook's own documentation is massively out of date and their recommendations not only don't work, the permissions tags no longer exist.

Has anyone solved this puzzle?

Upvotes: 0

Views: 1314

Answers (1)

DrDub
DrDub

Reputation: 1

You have to use the test user to create a test page and then issue commands directly through the graph API (using curl, for example) to allow the page to use the app. The details for doing that are available on a FB bug report linked in this answer Can you use Facebook "Test Users" to test a Messenger Bot?

The test user cannot see your own pages nor see you but you can see the test page created by the test user and interact with it. Sadly, because the test user cannot see you, the bot cannot get the information about the user interacting with the page either (which might cause exceptions in your bot code). The best way is to interact using a separate test user.

Upvotes: 0

Related Questions