Facebook API - 如何访问我的相册? [英] Facebook API - How to access my photo album?

查看:247
本文介绍了Facebook API - 如何访问我的相册?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在网站上显示我的Facebook相册中的照片。什么是实现它的好方法?

I want to display photos from my Facebook albums on a website. What would be good way to achieve it?

我需要oAuth身份验证,还是只能在某个地方授予我的网站或应用程序访问我的相册?我不想在我的网站上有一个Facebook登录或auth对话框。

Do I need oAuth authentication or can I just somewhere grant my website or application access to my albums? I don't want to have a Facebook login or auth dialog on my website.

推荐答案

你需要做什么: p>

What you need to do:


  1. 更改您的隐私设置,让所有人都可以看到您的照片。并为您的用户帐户的Facebook应用程序添加权限。

  2. 通过OAuth验证和检索访问令牌,但不要为作为应用程序的用户执行此操作。在这里阅读更多信息: http://developers.facebook.com/docs/authentication/#applogin

  3. 然后,您可以调用api方法来检索{user id} / albums的相册,这将为您提供您的相册列表。

  4. 选择您要使用的相册,然后调用api方法检索相册中的照片,该照片是{album id} / photos

  1. Change your privacy settings to that everyone can see your photos. And add permissions for you Facebook application for your user account.
  2. Authenticate and retrieve access token through OAuth, BUT instead of doing it for the user you do it as the application. Read more about it here: http://developers.facebook.com/docs/authentication/#applogin
  3. You then call the api method to retrieve albums which is "{ user id }/albums" which will give you a list of your albums.
  4. Select the album you want to use and then call the api method to retrieve photos in the album which is "{ album id }/photos"


    然后你完成了,你有一张该专辑中所有照片的列表。您甚至可以获得不同维度的所有来源。

And then you are done, you have a list of all the photos in that album. You even get all the sources for the different dimensions.

这篇关于Facebook API - 如何访问我的相册?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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