Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook test accounts with pages

I'm creating a system which involves these steps:
1. Facebook user logs in with Facebook login (manage_pages scope)
2. One of user's Facebook page's access_token is being collected
3. Page's access token is then extended and stored in database for further use

The problem is, that I need to test it and when it comes to Facebook's "test-users", they just can't create a page. I created regular account for this purpose and added it as a Tester in Roles. But as I know it violates rules of Facebook and it's getting annoying as they trying to ban that account (and eventually will). Any ideas? Thanks!

P.s. sorry for any mistakes, not a native speaker.

like image 855
rokastokas Avatar asked May 29 '18 14:05

rokastokas


1 Answers

I ran into this same issue and was finally able to create a Test Page for a Test User. The basic instructions are found at https://developers.facebook.com/docs/apps/test-pages, but I will add how to actually create the Test Page using the Graph API Explorer.

  1. Create a Test User.

    enter image description here

  2. Click Change permissions this test user granted to app to ensure the manage_pages permission has been applied.

    enter image description here

    enter image description here

  3. Get a User access token for the Test User.

    enter image description here

  4. Go to the Graph API Explorer. Paste in the user Access Token you copied. Set the action to POST and enter the path like /[TEST_USER_ID_HERE]/accounts then enter fields corresponding to the following parameters (feel free to change the values):

    { "name": "Test Page", "category_enum": "MEDIA", "about": "About test page", "picture": "[URL TO A PICTURE]", "cover_photo": { "url": "[URL TO A COVER PHOTO]" } }

enter image description here

(note if you use the new beta version of the Graph Explorer, you can switch to JSON mode and just paste in the JSON directly)

Once that completes, it will return the new Test Page's ID. You can also call /[TEST_USER_ID_HERE]/accounts with the GET action to see that Page's ID again.

like image 111
John Washam Avatar answered Sep 24 '22 15:09

John Washam