Black Friday / Cyber Monday Special - 10% Off - Use "CYBER10" at checkout!

Topic-icon Get Photos from Albums - Was working before.

Active Subscriptions:

None
3 years 3 weeks ago #64768 by Ivan
Hi,

Previously I was getting photos using the code below to first get album ids then get the photos. I can still get a list of albums but I can no longer get the photos listed in the album.
From the documentation it seems I am missing an access token. How can i get this access token from JFBConnect to pass to the photos function getAlbumById?




function getAlbums ()
{
try {
return $this->api('me/albums');

}
catch (Exception $ex) {
return array();
}
}




function getAlbumById ($aid)
{
try {
$photos = $this->api($aid.'/photos');
return $photos;
}
catch (Exception $ex) {
return array();
}
}
The topic has been locked.
Active Subscriptions:

None
3 years 3 weeks ago #64771 by Ivan
I have tried this:
$params['access_token'] = JFBCFactory::usermap()->getUserAccessToken($userid, 'facebook');
          
		  
		    $photos = $this->api('/'.$fbuserid.'/photos', $params['access_token']);

But no luck
The topic has been locked.
Support Specialist
3 years 3 weeks ago #64774 by alzander
I just read through the photos endpoint documentation from Facebook.

In there, it says:

Permissions
Any valid access token for any photo with public privacy settings.
For any photos uploaded by someone, and any photos in which they have been tagged - A user access token for that person with user_photos permission


If the image is public, you should be able to see it always. If it's a private photo, I'd recommend checking the token you're using in the Access Token Debug Tools to make sure you have the user_photos permission.

I hope that helps, but if not, please let me know!

Thanks,
Alex
The topic has been locked.
Social Stream
Hide. Seek. Play!

Countdown Hide & Seek Game

Countdown, the new hide & seek toy, is available now! Designed and developed by the founders of SourceCoast, it's the perfect toy to get your kids moving at all ages.

Learn More About the Hide and Seek Toy