-1

A few months ago I used to get Facebook friends ids with the graph api friendlists field. With this ids I was able to to get their friends picture with this kind of url : https://graph.facebook.com/{facebookId}/picture?type=square

It doesn't work anymore, now when I try to load these urls in my browser I get the following message:

"error": {
      "message": "(#12) picture edge for this type is deprecated for versions v2.3 and higher",
      "type": "OAuthException",
      "code": 12,
      "fbtrace_id": "FVhzO+b8CAh"
   }

I am not even sure that the ids I get from the friendlists field are still friends Id, it seems to be something like list ids (what is a good thing for a field named friendists :D) because the ids start with the same six digits.

Is there a way to get all my friends ids? Am I doing something wrong now or has there been a change in the graph api rules in the last few months? My goal is to get friends pictures and to make my own leaderboard from my database because with the Facebook api I cannot fill the leaderboard if the player gives a "only me" visibility.

Thank you,

Alex

Alex9494
  • 1,588
  • 3
  • 12
  • 22

1 Answers1

0

You can get a list of your friends ids using the friend API:

GET /v2.10/{user-id}/friends

You can then access their profile picture directly via this URL:

https://graph.facebook.com/v2.10/{userId}/picture?type=square
Milk
  • 2,469
  • 5
  • 31
  • 54
  • Hi yes I can get my own picture as well, my issue is to get my friend's' picture / ids. – Alex9494 Aug 03 '17 at 20:45
  • I'm not currently logged in to Facebook and can still access mine. So perhaps it's a privacy/permissions issue. Are you passing through the [access token](https://developers.facebook.com/docs/facebook-login/access-tokens/) – Milk Aug 03 '17 at 20:51
  • Im testing with Facebook explorer so yes I pass through the user access token. I can also get my picture with the url when Im logged out from Facebook. But what I want is to get my friends' ids so that I can get their picture and make my leaderboard. – Alex9494 Aug 03 '17 at 21:42
  • Sorry, that wasn't clear from the question. You can get your friends ids using the [friends API](https://developers.facebook.com/docs/graph-api/reference/user/friends) – Milk Aug 03 '17 at 22:15
  • My issue with the friends API is that if the user gives a "only me" user_friends permission, I won't be able to see his friends. I made it [this way](https://stackoverflow.com/questions/43000430/how-to-get-all-facebook-friends-score-android) to avoid the "only me" permission but it doesn't seem to work anymore. Do you see how to make it work ? – Alex9494 Aug 04 '17 at 07:57