tjameeli
tjameeli

Reputation: 47

Accessing Facebook Page Posts in Development

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

Upvotes: 0

Views: 370

Answers (2)

tjameeli
tjameeli

Reputation: 47

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

Upvotes: 1

Related Questions