views:

174

answers:

2

Hi folks,

Again a question on Facebook graph API. I would like to get friends of friends via an API call and when I try to do it, I get the following exception,

{

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

The URL I am trying to access is,

https://graph.facebook.com/friend_id/friends?access_token=access_token

I am getting extended permissions which is as follows,

<fb:login-button perms="user_likes,friends_likes"></fb:login-button>

Could any one please let me know whats getting wrong here? or Does it mean I can never get access to friends of friends?

Thanks, J

A: 

Unfortunately, I can't ask your answer specifically since I don't have experience with the FB API. However, I believe that FB allows users to hide who their friends are. If they have this set, then perhaps you won't be able to access their friends at all. I'd try to modify your code to first check what the permissions of a given user are and only then accessing their friends list if you have access to it. A bit of speculation here, though.

jlv
Well, I also tried to create two profiles with all access to friends and test it. DOes not seem to work :(
Abhishek
A: 

Currently, there is no extended permission that allows you to view a user's friends of friends. The "*_likes" permissions just show you the Facebook pages that the users have Liked.

It might be possible for you to iteratively fetch and cache the friends of each of the user's friends, one by one, but without access tokens for each friend, you'll only be able to fetch public data.

Raphomet

related questions