facebook graph api..获取朋友的朋友

发布于 2024-11-01 16:47:57 字数 347 浏览 7 评论 0原文

我正在使用 FB graph api 来获取我朋友的朋友列表,使用方法:

https://graph.facebook.com/<id>/friends?access_token=<token>

现在奇怪的是,这对我的一些朋友有效,而对其他一些朋友不起作用。有人可以告诉我为什么会发生这种情况以及可能的解决方法吗?

如果它不起作用,我会收到以下消息: “无法查找 YYYYYY 的所有好友。 只能查找已登录的用户 (XXXXX),或者 具有适当权限的登录用户的朋友”

我重复一遍,我能够使用上述 URL 获取我的一些朋友的朋友列表。 这里提到了哪些权限?

I am using the FB graph api to get a list of my friends' friends using:

https://graph.facebook.com/<id>/friends?access_token=<token>

Now the weird thing is that this works for some of my friends and does not work for some others. Could somebody tell me why this is happening and a possible fix?

In cases where it does not work, I get the following message:
"Can't lookup all friends of YYYYYY.
Can only lookup for the logged in user (XXXXX), or
friends of the logged in user with the appropriate permission"

And I repeat, I AM ABLE to get friend lists of some of my friends using the above URL.
What permissions are being mentioned here?

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

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

发布评论

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

评论(3

夏有森光若流苏 2024-11-08 16:47:57

隐私权限。

作为用户,我可以控制谁可以查看我的好友列表。如果我选择“仅限朋友”,那么只有我的朋友可以看到我的列表,而不是“朋友的朋友”。

登录 facebook,在右上角单击“帐户”->“朋友的朋友”。隐私设置,
然后点击“在 Facebook 上连接”下的“查看设置”,

“查看你的朋友列表”就是控制它的因素。

编辑:抱歉,不得不考虑一下。

可以通过标准 Facebook 网络用户界面查看您朋友的朋友。你的应用程序不是你。即使您已授予应用程序访问您帐户的权限,但您的朋友却没有。在这种情况下,您将无法找回您朋友的朋友,除非他们将其设置为“所有人”。您的应用程序不是朋友的朋友。

我相信这就是原因。另一个原因可能是他们的 API 因存在缺陷而闻名。您可以随时在 http://bugs.developers.facebook.net/ 上打开错误报告,如果我的猜测是正确的,会有人告诉你的。

Privacy permissions.

As a user, I control who can see my friends list. If I select "Friends only" then only my friends can see my list, not "friends of friends"

Log into facebook, on the upper right click on Account -> Privacy settings,
then Click on "View Settings" under "Connecting on Facebook"

"See your friends list" is what controls this.

Edit: Sorry, had to think about that for a minute.

You can see your friend's friends via the standard Facebook web UI. Your app is not you. Even though you've granted the app access to your account, your friends have not. In that case, you're not going to get back your friend's friends unless they have it set to "Everyone". Your app is not a friend of a friend.

I believe that's the reason. The other reason could be that their API is renown for being buggy. You could always open a bug report on http://bugs.developers.facebook.net/ and if my supposition is correct, someone will let you know.

软的没边 2024-11-08 16:47:57

我有朋友的朋友(有限)。我有同样的问题。虽然回答问题已经很晚了,但它会对某人有所帮助。这就是为什么回答这个问题。

我们可以找到应用程序用户的朋友的朋友。
尝试通过此 fql 查询。

$fb_id= 朋友的朋友需要的用户ID。

$query="SELECT uid, name, work_history  FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 IN (SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = $fb_id ) and is_app_user=1) )";
        $user_info=$facebook->api(array('method'=>'fql.query',
                    'query'=>$query));

I got friends of friends(limited). I had same problem. Though it is very late for answering question, it will help somebody. That's why answering this question.

We can get friends of friends those are app users.
Try by this fql query.

$fb_id= user id whose friends of friends required.

$query="SELECT uid, name, work_history  FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 IN (SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = $fb_id ) and is_app_user=1) )";
        $user_info=$facebook->api(array('method'=>'fql.query',
                    'query'=>$query));
祁梦 2024-11-08 16:47:57

的确。都是http请求。但是,如果我点击链接显示 John 的朋友,Facebook 会列出他们,如果我使用图形 API 和令牌,则不会。不管怎样,这是我问的,但 api 不一致。

Indeed. It's all http requests. But if I click on the link to show John's friends, facebook lists them, and if I use the graph api and a token, it doesn't. Either way it's me asking, but the api is inconsistent.

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