Search code examples
facebookfacebook-graph-apifacebook-friends

Facebook friends list is empty, just for one specific user


Simply executing this query aiming to list all my friend's friends:

GET https://graph.facebook.com/hisFacebookUserId/friends?return_ssl_resources=1&access_token=hisAccessToken

I obtain an empty data entry. => as if it had 0 friends. (but he has 800).

However, it works for many other users.

What might be the reason?


Solution

  • Since v2.0 of the Facebook API, you can only get the friends who authorized your App too. It´s a (privacy) feature, not a bug.

    https://developers.facebook.com/docs/apps/changelog

    Also, it´s not necessary to use an ID for the call, because you can only get the friends of the authorized User anyway:

    /me/friends
    

    Btw, don´t forget to authorize Users with the user_friends permission.