AdviceBot / FriendBot

Apache License 2.0
0 stars 0 forks source link

Configure test app with test users #22

Open Ninani opened 4 years ago

Ninani commented 4 years ago

Configure test Facebook page and messenger with a pool of test users (friends) and add credentials to develop pipeline.

https://developers.facebook.com/docs/apps/test-users/ https://github.com/AdviceBot/FriendBot/issues/18#issuecomment-623076014

Requirement for https://github.com/AdviceBot/FriendBot/issues/18

Ninani commented 4 years ago

Request to create test page by test user (in our case Page Owner).

POST:

https://graph.facebook.com/{TEST-USER-ID}/accounts?access_token={TEST-USER-TOKEN}&category_enum=COMMUNITY_SERVICES&name=FriendBot2&about=Friend Bot test page&picture={PIC-URL}&cover_photo={"url": "{PIC-URL}"}

Assign test page to application: https://developers.facebook.com/support/bugs/230322797329131/?disable_redirect=0 GET:

https://graph.facebook.com/v2.6/me/accounts?access_token={TEST-USER-ACCESS-TOKEN}

RESP:

{
    "data": [
        {
            "access_token": "{TEST-PAGE-ACCESS-TOKEN}",

...

POST:

https://graph.facebook.com/v2.6/me/subscribed_apps?method=POST&access_token={TEST-PAGE-ACCESS-TOKEN}&subscribed_fields=['messages', 'messaging_postbacks']
Ninani commented 4 years ago

Test page: https://www.facebook.com/FriendBot2-105409341217679/ available from our accounts (with admin role) or Page Owner test user

Ninani commented 4 years ago

FriendBot - Test1 test page: https://www.facebook.com/FriendBot2-104157231347877/