Graph API returns 'false' or 'Unsupported get request' accessing public Facebook Page
Asked Answered
C

6

22

I've been having some problems with a few Fan Pages and getting their details with the Facebook Graph API.

When I try to get the details for the Fan page, Graph API only returned false, but is now returning

{
    "error": {
        "message": "Unsupported get request.",
        "type": "GraphMethodException",
        "code": 100
     }
}

This is not the situation with all Facebook Pages, just for a few.

For example, when I try to get the details for this page at https://graph.facebook.com/CaptainMorganMacedonia, it only returns an error.

The page is public and has more than 25 fans, but I still have problems fetching the details of the page. Is it something with Facebook, or does the page have some bad configuration?

Crossbreed answered 27/7, 2011 at 11:48 Comment(0)
M
33

Assuming the page is Alcohol gated (In the OP's example the page was an alcohol page) you must access the page with an access token for a user who meets the alcohol restrictions.

For alcohol specifically, any user over 21 should be able to do this, and for some markets it's lower (depending on the drinking age in that market).

In the general case, if a page has demographic (country or age) restrictions on its visiblity, is restricted for alcohol reasons, or is unpublished, A Page or App access token will not work when trying to access that page's details or feed.

You must use a user access token for a user who has permission to view the page.

If the user does not meet the restrictions placed by the page admin, false was returned.

This has (since September 2012) been replaced with an OauthException with the text Unsupported get request. and code 100

This is a catch-all error which usually means a privacy check has failed. For pages, the cause is almost certainly that the page is unpublished, gated to certain countries or age groups, or marked as an alcohol page

Malebranche answered 27/7, 2011 at 15:32 Comment(6)
thanks so much, was banging my head for hours. facebook is such a pain in the ass.Humphrey
Short version is that if a user can't see something on Facebook.com, we don't let that user see it via the API either, which means if something is restricted, your app needs to prove that you're acting on behalf of a user who can see the content, which is done by using their access token There are a few edge cases where this doesn't make perfect sense, but in general I think the behaviour is correct, if not necessarily obviousMalebranche
@Malebranche But it goes further. I use my user access token. I can see events of a person on facebook, but cannot fetch them using graph api. See this bug: developers.facebook.com/bugs/…Attar
That's in no way related to the issue in this answerMalebranche
Where the UnknownColumn do you get a 21+ api key? I made a key with a profile which is old enough.Scrimp
Yes, I had the same issue, was caused by the page not being published.Illustrate
H
13

A picture is worth a thousand words.

If you change even only one of these settings:

Facebook Page Settings

This is the response your client will receive:

{ "error": {
      "message": "Unsupported get request.",
      "type": "GraphMethodException",
      "code": 100
   }
}

Actually I have tried changing "Age Restrictions" and every setting which is not "Anyone (13)", will cause this problem.

Hackett answered 15/4, 2014 at 8:30 Comment(0)
M
3

It seems the Graph API returns false or some empty data when you try to access resources which have been restricted. For example, administrators of Facebook fan pages can restrict their access by age (this includes a special setting for pages about alcohol):

Selecting an age restriction means that anyone under the specified age will not be able to find your Page in search or on friends' profiles or view the content in other ways. This also means that logged out users will not be able to see your Page.

The Alcohol-Related age restriction sets the minimum age based on the location of the user. Only users in Canada, South Korea or Nicaragua who are 19+, in Japan, Iceland or Paraguay who are 20+, in Cameroon, Micronesia, Palau, Solomon Islands, Sri Lanka or the U.S. who are 21+, in India and Sweden who are 25+, and elsewhere who are 18+ will be able to view your Page. You understand that the Alcohol-Related age restriction is for convenience and that Facebook does not represent that by using that setting your Page will be legally compliant in all countries where your Page is visible. You understand that ultimately you are responsible for setting the proper legally compliant age restrictions for each country where your Page is visible.

They can also limit their access by country:

Enter one or more countries and then choose whether you want the page to be visible to or hidden from people in the listed countries. Entering one or more countries means that logged out users will not be able to see your Page. If no countries are listed, your Page will be visible to people located in all countries. You understand that you are responsible for setting the proper country restrictions to ensure that the content of your Page is appropriate for the country or countries where you allow it to be visible

For example, you will not be able to see this page if you are not logged into Facebook (you will be redirected to the Facebook homepage). And this is the same in the Graph API. Calling:

http://graph.facebook.com/105226926239

Will return:

false

However, if you manage to get an user access token (for example from the Graph API Explorer), and assuming the corresponding profile matches the restrictions defined for this page:

https://graph.facebook.com/105226926239?access_token=AAACEdEose0cBACIijRIMtayOiN5F58x6DxolYi8ezmpAIPORApnfQvG5Kj1ftOQhSzIgxkNxQiu4iBwozqRT3zTvswEvm0O0JobZC8AZDZD

Will return:

{
   "id": "105226926239",
   "name": "CodeReduc.com",
   "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/71056_105226926239_2230111_s.jpg",
   "link": "http://www.facebook.com/pages/CodeReduccom/105226926239",
   "likes": 1,
   "category": "Local business",
   "is_published": true
}

Unfortunately, it is not possible to use an application access token to retrieve this information, which could be useful in some cases.

Maisel answered 27/7, 2011 at 11:48 Comment(0)
L
3

I had this issue but it was a country restriction that was causing the problem (even though I was in the correct country). Removing it solved the problem. Check if you have any restrictions that might seem irrelevant, because they could be causing the blockage.

Limeade answered 16/11, 2011 at 9:55 Comment(0)
M
0

Y Solved it in Settings-->Contact Email: type it. Then go to Status & Review and put it on the Do you want to make this app and all its live features available to the general public? option at top of the page.

Also make sure that the age restrictions +13 and country is not set.

Maximin answered 4/2, 2015 at 7:17 Comment(0)
F
0

In addition to all the answers above, not that enabling the "Social Discovery/App shows up in Newsfeed" setting also triggers this problem.

Flagrant answered 25/1, 2016 at 15:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.