Alex Rivera | Logout

Getting friends of friends in FB graph API

Asked 2010-09-29T03:52:13.870
9

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 what's going wrong here? Or does it mean I can never get access to friends of friends?

Edit
Report

1 Answer

-1

You can get the friends of the current user through a Graph API call to me/friends. You will need any valid access_token, no special extended permissions, just the Basic one. There is one caveat, that user must allow you to see their friend list. So in the Privacy Settings > Connecting on Facebook there is a "See your friend list" setting. If the user has chosen a custom setting and selected say "Only Me" you will get this error.

Similarly, if the current user allows others to see their friend list, but one of the friends shuts this down due to privacy concerns then you will not be able to see any data and will get that error.

I was able to verify the scenarios I have described.

answered 2011-07-28T05:40:56.693

Your Answer