如何使用FBGraph Api获取相册和相册照片的封面照片 [英] How to get cover photo of album and photos of the album using FBGraph Api

查看:168
本文介绍了如何使用FBGraph Api获取相册和相册照片的封面照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用FBGraphAPI。我设法得到专辑列表。我试图在相册中获得picutre(cover_photo)和照片。但是不知何故,我坚持下去。



我需要使用哪种内置方法来获取相册中的cover_photo和照片?如何使用它?

解决方案

要获取cover_photo,您需要使用

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

其中id是从相册列表中返回的相册的cover_photo。
和令牌是您当前的会话令牌



注意。它需要是https,您需要指定令牌。这是使它与例如渲染用户的照片不同的。



通过相册中的照片,不知道您的意思是照片列表还是照片本身?
基本过程是使用返回的相册的ID,然后调用

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

这将返回相册中的照片列表。
这个列表中的source包含照片的URL。
也是不同照片分辨率的字典。


I am working with FBGraphAPI in my project. I managed to get 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.

这篇关于如何使用FBGraph Api获取相册和相册照片的封面照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆