Even with a valid access_token with right set of permissions, FacebookClient does not get ALL of the photos for given album id

StackOverflow https://stackoverflow.com/questions/22827638

Question

Using Facebook Graph API, I am trying to get ALL of the photos from a given album ID. I tried finding it on Facebook Graph Reference site, but couldn't find any help. So here it is what I am doing.

I have a valid access token with permission of user_photos and friend_photos. I already verified that facebook debugger site. I already have the album id. And following is my URL that I am passing:

https://graph.facebook.com/<albumId>/photos?access_token=<my-valid-access-token>

I do get 4 photos, but I have 29 photos in total. Also, I don't see any cursor for "prev" or "next". So, now, I am lost. Don't know what I am missing here. Any help is appreciated. I am using Facebook SDK for .NET.

Was it helpful?

Solution

So, here is the solution that worked for me: For facebook options, I already had "user_photos" and "friend_photos" as part of the scope. "friend_photos" is not really relevant here. I had to ADD "user_checkins" to the scope collection to get all of the photos that I had in my given album. So here it is that I am using now, and getting things working for me. Graph API Explorer was super helpful for me when I was investigatiing this.

var facebookOptions = new Microsoft.Owin.Security.Facebook.FacebookAuthenticationOptions{...};
facebookOptions.Scope.Add("email");
facebookOptions.Scope.Add("user_about_me");
facebookOptions.Scope.Add("user_events");
facebookOptions.Scope.Add("user_groups");
facebookOptions.Scope.Add("user_likes");
facebookOptions.Scope.Add("user_photos");
facebookOptions.Scope.Add("user_videos");
facebookOptions.Scope.Add("user_checkins");
facebookOptions.Scope.Add("user_friends");
facebookOptions.Scope.Add("user_location");
facebookOptions.Scope.Add("user_photo_video_tags");
facebookOptions.Scope.Add("user_actions.music");
facebookOptions.Scope.Add("user_activities");
app.UseFacebookAuthentication(facebookOptions);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top