Search code examples
facebook-graph-apiphotos

Why does the API not return photos and albums which are visible to the authenticated user? (Has friends_photos permission)


Edit: Made an official bug report at developers.Facebook.com

GETing either of the following:

graph.facebook.com/me/photos
graph.facebook.com/me/albums

returns lots of photos.

GETing:

graph.facebook.com/1146720040/photos
graph.facebook.com/1146720040/albums

Returns:

{
  "data": [
  ]
}

1146720040 is a friend, and I DO have the friends_photos permission. I've tried this with ~10 different users, all friends, and none have returned any photos. All of the users have photos I can see when I browse to facebook.com.

Why is the API not returning photos and albums that are visible in the browser?

PS: I'm using https://developers.facebook.com/tools/explorer/ to test the queries, in case that matters.


Solution

  • The call graph.facebook.com/[user_id]/photos returns photos that user is tagged in, for that user. AFAIK you can't use it to retrieve anyone's photos but the logged in users.

    You need to use graph.facebook.com/[album_id]/photos to get friend's photos.

    To get there from user you have to get a list of album_ids from an individual friend.