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

1

6

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!

Fleta answered 15/11, 2016 at 23:18 Comment(0)
G
7

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 !

Gileadite answered 16/11, 2016 at 0:5 Comment(3)
Nice one Simon thank you!, I'll give it a go shortly.Fleta
Thanks Simon, this working - one thing to make anyone does that comes across this is to exchange the short lived page token for a long one. Otherwise as soon as your test user logs out your bot won't be able to take to the test page again. developers.facebook.com/docs/facebook-login/access-tokens/… GET /oauth/access_token? grant_type=fb_exchange_token&amp; client_id={app-id}&amp; client_secret={app-secret}&amp; fb_exchange_token={short-lived-token}Fleta
I can't get the info about accounts, this is the result: { "data": [] }Winstead

© 2022 - 2024 — McMap. All rights reserved.