2014-05-11 36 views
0

如何獲得只有訪問令牌和'user_photos'權限的所有facebook配置文件圖片?如何獲得只有訪問令牌和'user_photos'權限的所有facebook profil圖片?

我不需要其他專輯或其他上傳的圖片,只有個人資料圖片。我有一個訪問令牌,其中包含'user_photos'權限。

該URL返回所有上傳的圖片: https://graph.facebook.com/me/photos/uploaded?access_token=XXXXXXXXXXXXXX

+1

然後,您必須先瀏覽用戶的相冊並找到名爲「個人資料照片」的相冊。 – CBroe

回答

1

如果你想這樣做在FQL,這是相當容易:

select pid, object_id, src from photo where album_object_id in (select object_id from album where name = 'Profile Pictures' and owner = me()) order by position 

記住FQL將在4月30日被棄用, 2015年

要通過圖形API做到這一點,你需要採取三個步驟:

  1. 專輯獲取列表(見https://developers.facebook.com/docs/graph-api/reference/v2.0/user/albums/

    /me/albums

  2. 解析您的應用程序的結果,並尋找專輯名稱「我的照片」

  3. 要求所有的照片在「個人資料照片「專輯(見https://developers.facebook.com/docs/graph-api/reference/v2.0/album/photos

    /{album_id}/photos

相關問題