开发者

How to get cover photo of album and photos of the album using FBGraph Api

开发者 https://www.devze.com 2023-03-31 18:06 出处:网络
I am working with FBGraphAPI in my project. I managed to g开发者_开发技巧et the list of albums. I tried to get picutre (cover_photo) and photos in albums. But somehow i stuck in it.

I am working with FBGraphAPI in my project. I managed to g开发者_开发技巧et the list of albums. I tried to get picutre (cover_photo) and photos in albums. But somehow i stuck in it.

Which inbuilt method i need to use to get cover_photo and photos in the album? And how to use it?


To get the cover_photo, you need to use

https://graph.facebook.com/<id>/picture?type=album&access_token=<token>

where id is the cover_photo from your album returned in the album list. and token is your current session token

Note. It needs to be https and you need to specify the token. This is what makes it different than, for example, rendering a user's photo.

By photos in album, not sure if you mean the list of photos or the actual photo itself? The basic process is to use the id of the album returned and then call

https://graph.facebook.com/<id>/photos

This will return a list of photos in the album. Within this list will be 'source' which contains the url of the photo. Also a dictionary of different photo resolutions.

0

精彩评论

暂无评论...
验证码 换一张
取 消