Graph API 返回“false”或“不支持的获取请求”访问公共 Facebook 页面
我在使用一些粉丝页面并使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
假设该页面是酒精门控的(在 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 code100
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
一张图片胜过一千个文字。
如果您仅更改以下设置之一:
这是您的客户将收到的响应:
实际上,我已尝试更改“年龄限制”,并且每个不是“任何人(13)”的设置都会导致此问题。
A picture is worth a thousand words.
If you change even only one of these settings:
This is the response your client will receive:
Actually I have tried changing "Age Restrictions" and every setting which is not "Anyone (13)", will cause this problem.
我遇到了这个问题,但这是导致问题的国家/地区限制(即使我位于正确的国家/地区)。删除它解决了问题。
检查是否有任何看似无关紧要的限制,因为它们可能会导致阻塞。
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.
当您尝试访问已受到限制的资源时,Graph API 似乎会返回
false
或一些空数据。例如,Facebook 粉丝页面的管理员可以按年龄限制他们的访问(这包括有关酒精的页面的特殊设置):他们还可以按国家/地区限制其访问:
例如,您将无法看到此页面 如果您未登录 Facebook(您将被重定向至 Facebook 主页)。这在 Graph API 中也是一样的。调用:
将返回:
但是,如果您设法获取用户访问令牌(例如从Graph API Explorer),并假设相应的配置文件符合为此页面定义的限制:
将返回:
不幸的是,无法使用应用程序访问令牌来检索此信息信息,在某些情况下可能有用。
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):They can also limit their access by country:
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:
Will return:
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:
Will return:
Unfortunately, it is not possible to use an application access token to retrieve this information, which could be useful in some cases.
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.
除了上述所有答案之外,启用“社交发现/应用程序显示在新闻源中”设置也会触发此问题。
In addition to all the answers above, not that enabling the "Social Discovery/App shows up in Newsfeed" setting also triggers this problem.