What is the best way to get ALL profile pictures from a given user? What permissions do I need?
I know I can access the main profile pic using https://graph.facebook.com/[uid]/picture
, but how do I get the entire album?
To see an album of your past profile or cover photos: From your Feed, tap your profile picture in the top right. Scroll down and tap Photos, then tap Albums at the top. Tap Profile Pictures or Cover Photos.
You can get user data by using the Facebook Graph API if the user has given their permission to share their data and your app has the appropriate permissions to receive this data. This topic shows you how to make a single request for data and how to have a batch of requests in a single request.
how do I get the entire album?
You need https://graph.facebook.com/[uid]/albums?access_token=[AUTH_TOKEN]
to get JSON array of all the albums of a user.
You will get three important things from here id
- album id, name
- album name, and type
- album type.
What permissions do I need?
The permission required is user_photos
see here
What is the best way to get ALL profile pictures from a given user?
Profile Pictures are under "Profile Pictures" album. To get to profile album, you need to look into albums array (as mentioned previously), iterate through the JSON result-set, until you get an album with name = Profile Pictures
and type = profile
. Get id
of this object. This is the profile pictures album.
Now you can access it similar to you access any other album. That is, https://graph.facebook.com/[ALBUM_ID]/photos?access_token=[AUTH_TOKEN]
this will list all the profile pictures of the user ever uploaded.
Hope this helps.
refer: http://developers.facebook.com/docs/reference/api/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With