Facebook Graph API 帮助,返回“false”但UID是公开的
我真的无法理解为什么在某些 Facebook 对象(更具体地说:用户帖子)上,当使用应用程序通过 OAuth 获取的 access_token 时,Graph API 返回 false,而不是使用用户 access_token。
我这里有一个例子: https://graph.facebook.com/10150158049595775?access_token=XXXXXXXXXX
此帖子是公开的,并且我与该用户没有共同的朋友。
如果您尝试使用通过通常的 Facebook OAuth 方案获得的令牌来访问上面的 url,服务器将返回“false”。
如果您使用您的用户访问令牌,例如 FB 通过访问此页面中的示例为您提供的令牌 http://developers.facebook.com/docs/reference/api/,Graph API 正确地为您提供用户的帖子详细信息。
我相信这不是需要扩展权限的问题,首先是因为上面的帖子是公开的,其次是因为为了测试,我尝试通过询问所有用户权限(是的,在开发人员身上找到的所有权限)来使我的应用程序生成令牌。 facebook.com/docs/authentication/permissions/),答案始终是“假”。
I really could not understand why on some Facebook objects (being more specific: user posts) the Graph API returns false when using an access_token obtained via OAuth by an application, but NOT by using a user access_token.
I have an example here:
https://graph.facebook.com/10150158049595775?access_token=XXXXXXXXXX
This post is public, and I have no friends in common with this user.
If you try to access the url above by using a token obtained via the usual Facebook OAuth scheme, the server return "false".
If you use your user access token, for example the one that FB gives you by visiting the examples in this page http://developers.facebook.com/docs/reference/api/, the Graph API correctly gives you the users's post detail.
I believe it's not a matter of extended permissions required, first because the post above is public, and second, because for testing I've tried to make my application generate a token by asking ALL user permissions (yes, all permissions found on developers.facebook.com/docs/authentication/permissions/) and the answer was always "false".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设这篇文章是“Facebook上的每个人都可以使用”,这可能是Facebook接受用户
access_token<的原因/code>(即以用户身份查看帖子)并且不接受申请
access_token
。另请注意,这无需
access_token
即可工作(如果您在前面添加所有者 ID):我猜测这被视为“公开访问” ”
I suppose this post is "Available to everyone on Facebook", which may be the reason why Facebook is accepting a user
access_token
(i.e. viewing the post as a user) and not accepting an applicationaccess_token
.Also note that this would work without
access_token
(if you prepend the owner id):I guess this is treated as "Publicly accessible"