开发者

Retrieve list of my friends' friend's in Facebook (PHP)

I am try to get a list of my friends' friend's. As they have added me as a friend, I am able to access their friends list开发者_JS百科s(friend lists are publicly accessible anyways).

but when I try to do it through the API, I get an error:

{"error":{"type":"OAuthException","message":"(#604) Can't lookup all friends of 100001150965395. Can only lookup for the logged in user (508424886), or friends of the logged in user with the appropriate permission"}} 

Is there any other way I can look up the list(without him specifically granting permission to the app)?

code that I am using is:

 <? $a=$cookie['access_token'];
      $url='https://graph.facebook.com/100001150965395/friends?access_token='.$a;
      $ch=curl_init();
      curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;


There is privacy setting in Facebook which can restrict Friends list to Friends alone. Since your app is not a Friend of the user id you are trying to access, you are restricted. You can check it by trying the profile URL in a new browser window (fresh session). It looks like the user id in question have prevented access to Friend's list.

http://www.facebook.com/profile.php?id=100001150965395

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜