Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Messenger Bot, test users, has anyone got this working?

We've created an FB messenger bot and can test it fine with real FB accounts. But we would like to create 2000 test users via the developer console/graph api.

The problem I've come across is that, test users (created via the API) can't see public pages. So I logged in as the test users, created a page, and great! test users can see test pages created by other test users. But now I can't link my bot to that page.

Has anyone managed to get this working? We have made a bot for a large corp and they want to send as many testers at it as possible.

The backup plan is that I create real FB accounts and use those...

Thanks!

like image 688
Paul Broomfield Avatar asked Nov 15 '16 23:11

Paul Broomfield


People also ask

How do you test a Facebook bot?

One easy way to achieve automated testing for messenger bots atleast is to try to mimic a request coming from FB. You can just log the request you are getting to your bot to find the signature of the request that FB sends. Then you can just pretend to be FB by sending http requests with the same signature.

How can you tell if a Facebook message is a bot?

Under the Home tab (house icon), you'll see a search bar at the top. Tap it. Facebook Messenger will then show you a small selection of bots it recommends (beneath a list of people you can start chats with). You can also use the search bar at the top of this screen to search for other available bots.

Is there a Messenger bot?

A Facebook Messenger bot is a chatbot that lives within Facebook Messenger, meaning it converses with some of the 1.3 billion people who use Facebook Messenger every month. Chatbots can be programmed to understand questions, provide answers, and execute tasks.

Why is Messenger bot not working?

The fix is - in your messenger settings, you will have to request for atleast one permission (i.e. pages_messaging) to allow your bot to send and receive messages. After selecting "Add to submission", you will have to complete the pre-requisites for submission and wait for response from Facebook.


1 Answers

You have to manually link your test user's created page with your bot, for that, first retrieve the test page ID using the following link :

https://graph.facebook.com/v2.6/me/accounts?access_token=<TEST_USER_ACCESS_TOKEN>

Then use the page token to link your bot using :

https://graph.facebook.com/v2.6/me/subscribed_apps?method=POST&access_token=<TEST_USER_PAGE_ACCESS_TOKEN>

(see https://developers.facebook.com/docs/messenger-platform/guides/setup#subscribe_app)

Here is the detailed workaround : https://developers.facebook.com/bugs/230322797329131/?hc_location=ufi

Hope this helps !

like image 104
Simon Oualid Avatar answered Dec 31 '22 00:12

Simon Oualid