Graph API 返回“false”或“不支持的获取请求”访问公共 Facebook 页面

发布于 2024-11-26 17:07:54 字数 683 浏览 0 评论 0原文

我在使用一些粉丝页面并使用 Facebook Graph API 获取其详细信息时遇到了一些问题。

当我尝试获取粉丝页面的详细信息时,Graph API 仅返回 false,但现在正在返回

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

这并不是所有 Facebook 页面的情况,只是少数情况。

例如,当我尝试获取 此页面 的详细信息时, https://graph.facebook.com/CaptainMorganMacedonia, 它只返回一个错误。

该页面是公开的并且拥有超过 25 个粉丝,但我在获取该页面的详细信息时仍然遇到问题。是 Facebook 的问题,还是页面配置有问题?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

淡莣 2024-12-03 17:07:55

假设该页面是酒精门控的(在 OP 的示例中,该页面是酒精页面),您必须使用符合酒精限制的用户的访问令牌来访问该页面。

特别是对于酒精饮料,任何 21 岁以上的用户都应该能够做到这一点,并且对于某些市场来说,它的要求更低(取决于该市场的饮酒年龄)。

一般情况下,如果页面的可见性受到人口统计(国家或年龄)限制、因饮酒原因而受到限制或未发布,则在尝试访问该页面的详细信息或提要时,页面或应用程序访问令牌将不起作用。

必须为有权查看该页面的用户使用用户访问令牌。

如果用户不满足页面管理员设置的限制,则返回 false

该错误已(自 2012 年 9 月起)替换为带有文本 Unsupported get request. 和代码 100 的 OauthException。

这是一个包罗万象的错误,通常意味着隐私检查已完成失败的。
对于页面,原因几乎可以肯定是该页面未发布、仅限于某些国家或年龄组,或者被标记为酒精页面

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

才能让你更想念 2024-12-03 17:07:55

一张图片胜过一千个文字。

如果您仅更改以下设置之一:

Facebook 页面设置

这是您的客户将收到的响应:

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

实际上,我已尝试更改“年龄限制”,并且每个不是“任何人(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.

风向决定发型 2024-12-03 17:07:55

我遇到了这个问题,但这是导致问题的国家/地区限制(即使我位于正确的国家/地区)。删除它解决了问题。
检查是否有任何看似无关紧要的限制,因为它们可能会导致阻塞。

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.

a√萤火虫的光℡ 2024-12-03 17:07:55

当您尝试访问已受到限制的资源时,Graph API 似乎会返回 false 或一些空数据。例如,Facebook 粉丝页面的管理员可以按年龄限制他们的访问(这包括有关酒精的页面的特殊设置):

选择年龄限制意味着任何低于指定年龄的人
将无法在搜索或朋友的个人资料中找到您的主页
或以其他方式查看内容。这也意味着注销
用户将无法看到您的主页。

与酒精相关的年龄限制根据
用户的位置。仅限加拿大、韩国或尼加拉瓜的用户
日本、冰岛或巴拉圭 19 岁以上 喀麦隆 20 岁以上
年满 21 岁的密克罗尼西亚、帕劳、所罗门群岛、斯里兰卡或美国,
在印度和瑞典,年满 25 岁的人,以及其他地方年满 18 岁的人将
能够查看您的页面。您了解与酒精相关的年龄
限制是为了方便,Facebook 并不代表
通过使用该设置,您的主页将在所有方面都合法合规
您的主页可见的国家/地区。你明白最终
您有责任设定适当的合法年龄
您的主页可见的每个国家/地区的限制。

他们还可以按国家/地区限制其访问:

输入一个或多个国家/地区,然后选择是否需要该页面
对所列国家/地区的人员可见或隐藏。
输入一个或多个国家意味着注销的用户将不会被
能够看到您的页面。如果没有列出国家/地区,您的主页将是
所有国家/地区的人们都可以看到。你明白你
负责制定适当的国家限制,以确保
您页面的内容适合该国家/地区或
您允许其可见的国家/地区

例如,您将无法看到此页面 如果您未登录 Facebook(您将被重定向至 Facebook 主页)。这在 Graph API 中也是一样的。调用:

http://graph.facebook.com/105226926239

将返回:

false

但是,如果您设法获取用户访问令牌(例如从Graph API Explorer),并假设相应的配置文件符合为此页面定义的限制:

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

将返回:

{
   "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
}

不幸的是,无法使用应用程序访问令牌来检索此信息信息,在某些情况下可能有用。

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.

雅心素梦 2024-12-03 17:07:55

Y 在“设置”-->“联系电子邮件”中解决了它:输入它。然后转到“状态和”。查看并将其放在“您想让此应用程序及其所有实时功能向公众开放吗?”页面顶部的选项。

另请确保未设置年龄限制 +13 和国家/地区。

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.

划一舟意中人 2024-12-03 17:07:55

除了上述所有答案之外,启用“社交发现/应用程序显示在新闻源中”设置也会触发此问题。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文