Facebook API - How to access my photo album?

天涯浪子 提交于 2019-11-30 04:46:48

问题


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

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.


回答1:


What you need to do:

  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.



来源:https://stackoverflow.com/questions/5708423/facebook-api-how-to-access-my-photo-album

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!