Facebook – Problem access graph api with some facebook page id/username

facebookfacebook-graph-apifacebook-page

I have successfully made an facebook application which shows real time data from facebook graph api with no authentication. The method i have used is something the simple connection to the graph api because i only need the basic info for it.

    $url = 'http://graph.facebook.com/'.$pagename;
    // for id
    $url = 'http://graph.facebook.com/'.$page_id;
    $pageinfo = json_decode(file_get_contents($url));

This methord works fine but not for some pages in facebook. My client has send those pages url to me. From my pc but can't access those page (facebook redirects me to the homepage). Also i have tried to access the graph via those page username and id. Its just returning false.

Here are those pages. Note that not all pages but a few has this problem:

https://www.facebook.com/MontanaDaleCarnegie

https://www.facebook.com/pages/The-Painted-Swan-Online-Marketing/223492000998546

I can't find the issue why these pages aren't accessible. Is there any settings in the page settings page that make the page nonpublic or inaccessible via graph api? The client saying that he can access these pages.

I need your experience an input to overcome this situation. Thanks!

Best Answer

Apparently if any page has privacy setting restricted the page info can't be access in public.

There is couple of cases:

  1. If the page is restricted to any country.
  2. If the page has any age restriction. Selected anything other then Anyone (13+)

enter image description here

You might find it helpfull http://bugs.developers.facebook.net/show_bug.cgi?id=18162 Check comment #3.

Related Topic