first_time_user
first_time_user

Reputation: 427

How to subscribe facebook test pages to facebook apps webhook

I am creating chatbot and want to connect on facebook. I want to test my messenger chatbot in my page, but I must do app review and business verification first and I don't want to do that since I just developed my chatbot (or you can say this is staging environment).

I found that we can create test users, test pages, and test apps. I already create them all, but I cannot find a way to subscribe webhook from my test app to my test pages. webhook

only real page appear in that select a page box.

How to subscribe my webhook to my test page? or is there any other way I can chat to my pages to test my chatbot without using business verification first?

Upvotes: 3

Views: 1445

Answers (2)

Peter Lorei
Peter Lorei

Reputation: 634

I struggled with this all day. Hopefully this can help someone out.

Here are the steps I took to get the interaction from a test user -> test page -> chatbot to work:

  • Create a test user within your developers.facebook App Dashboard (Roles, Test Users)

  • Login with the test user and create a page (Test Users -> Edit -> Login with this test user)

  • Get a long-lived page access token that has the scopes:

    pages_messaging pages_show_list pages_manage_metadata pages_messaging_subscriptions (this is needed to register the webhook)

  • Use the page access token to programmatically register a webhook for the test page (don't think you can manually add from the dashboard):

    POST to https://graph.facebook.com/v9.0/{testPageId}/subscribed_apps?subscribed_fields=messages,messaging_postbacks&access_token={longlivedPageAccessToken}

note: using graphAPI 9.0 for all requests

Upvotes: 1

IAmBotmaker
IAmBotmaker

Reputation: 352

Unfortunately, Facebook test apps / test pages / test users is buggy and seem to not work as expected. (I spent a few hours trying to figure that out)

They seem to focus on real user accounts.

We do not need to do business verification when Status of the app is: In Development

HINT: You can create a real user account in Facebook with any anonymous "false identity" name - so that your identity feels more anonymous and all the pages attached to it - whether published or not. (RISKS: But do not forget your password for this FB account, as you will not be able to recover this "second" FB account, as they might require your passport with that false identity "name" for recovery)

Then - you can create page by admin from real app in Facebook for Developers: Settings -> Advanced -> App Page -> Create Page

And then - just connect your bot to Webhooks in a standard way.

Upvotes: 1

Related Questions