0

I'm trying to get page data as the Administrator of my Facebook App but I'm getting error #10: To use 'Page Public Content Access', your use of this endpoint must be reviewed and approved by Facebook.

I thought that as an Administrator I would have access for testing purposes? Is my request incorrect? I've made this as simple as possible by using JavaScript, so no server side code at all.

My AppID and AppSecret are as defined on the Settings/Basic page of https://developers.facebook.com

Please advise:

var getAccessTokenURL = 'https://graph.facebook.com/oauth/access_token?type=client_cred&client_id='+appID+'&client_secret='+appSecret;
httpGetAsync(getAccessTokenURL, function(text) {
    var json = jQuery.parseJSON(text);
    var accessToken = json.access_token;
    var url = 'https://graph.facebook.com/' + pageID + '/feed?access_token=' + accessToken;
    httpGetAsync(url, function(text) {console.log(text);})
})   

My response is:

{
   "error": {
      "message": "(#10) To use 'Page Public Content Access', your use of this endpoint must be reviewed and approved by Facebook. To submit this 'Page Public Content Access' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.",
      "type": "OAuthException",
      "code": 10
   }
}

Apologies if this is obviously or has already been asked, I've had a look but cannot find clear documentation about this

Thanks

tjameeli
  • 37
  • 1
  • 8

2 Answers2

1

You need to use a Page Token, and test with a Page you manage.

Links:

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • I am the admin of the page, how do I grant the extended permission "manage_pages"? When I go to https://developers.facebook.com/apps/App_ID/app-review/permissions/ the only action is "Request" which sends a request to Facebook for an App Review – tjameeli Feb 18 '19 at 13:47
  • your question states that you want to access page content in development. you don´t need review for development, of course. you should read this: https://developers.facebook.com/docs/facebook-login/overview - you need to authorize your user with the manage_pages permission. – andyrandy Feb 18 '19 at 14:08
  • for example, just with the js sdk: http://www.devils-heaven.com/facebook-javascript-sdk-login/ - check out the "scope" parameter for adding permissions. – andyrandy Feb 18 '19 at 14:10
  • I think I have misunderstood something, do I need to login to view public posts? Do I need to add user details to the method I call "https://graph.facebook.com/PAGE_ID/feed" ? If so please could you provide a code snippet. Thanks. – tjameeli Feb 22 '19 at 08:52
  • if you want to access the feed of YOUR page, you need to authorize/login and generate a page token. code can easily be found in the api reference: https://developers.facebook.com/docs/graph-api/reference/v3.2/page/feed – andyrandy Feb 22 '19 at 09:15
  • Thanks for your help. I still don't understand, I've already read this page and it doesn't explain how to login and generate a page token? There are no clear code example for get requests either – tjameeli Feb 22 '19 at 12:25
  • just google for it, "how to generate a page token" would be a good search text, for example. it leads to this thread, with an answer of mine: https://stackoverflow.com/questions/25470403/how-to-get-page-access-token-by-code – andyrandy Feb 22 '19 at 12:42
  • thank you very much, this is what I was searching for: https://developers.facebook.com/tools/explorer/ – tjameeli Feb 22 '19 at 13:08
  • thank you for all your help, I've added the full solution as a separate answer for anyone like me who didn't understand! – tjameeli Feb 22 '19 at 14:32
1

To get api access to public published page data:

  1. Create an app for the facebook page:https://developers.facebook.com/apps/
  2. Generate a "User Access Token": https://developers.facebook.com/tools/explorer/
  3. Extend the token to be used for 60 days: https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id=APP_ID&client_secret=APP_SECRET&fb_exchange_token=ACCESS_TOKEN

Where APP_ID and APP_SECRET are on the Facebook app under Settings->Basic

  1. Get page info: https://graph.facebook.com/v3.2/PAGE_ID?access_token=ACCESS_TOKEN
  2. Get posts: https://graph.facebook.com/v3.2/PAGE_ID/feed?access_token=ACCESS_TOKEN
tjameeli
  • 37
  • 1
  • 8