2017-03-03 45 views
2

我一直在使用Graph API,但我無法弄清楚這一點。 我有一個組ID,從誰的飼料我想獲得圖像網址的所有可用的決議。如何從組飼料中獲取圖像字段 - Facebook Graph API

我知道我可以使用照片ID的'圖像'字段。 下面是一個示例代碼,獲取

<group-id>/feed?fields=attachments{target{id}} 

我試圖

<group-id>/feed?fields=attachments{target{id{images}}} 

而且這個

<group-id>/feed?fields=attachments.fields(target.fields(id{images})) 

<group-id>/feed?fields=attachments.fields(target.fields(id.fields(images))) 

他們全部返回的ID JSON哈維這個ID,但不是我需要的圖像細節。

我希望我已經提供了足夠的信息。

回答

1

您可以使用下面的格式,而調用API,它會回報你與圖像的URL包括在後

<group-id>/feed?fields=created_time,attachments,message 

您將獲得以下格式的響應。

{ 
     "created_time": "2017-11-16T06:21:37+0000", 
     "id": "543993212434753_1004360179731385", 
     "attachments": { 
     "data": [ 
      { 
      "description": "Best #ethnic wear store for #women. 
Shop Now>> sairandhri.com", 
      "media": { 
       "image": { 
       "height": 720, 
       "src": "https://scontent.xx.fbcdn.net/v/t1.0-9/s720x720/23519069_887109751445971_6170575397465061641_n.jpg?oh=170436ae447ec615f547d700017c67b4&oe=5AA4F844", 
       "width": 537 
       } 
      }, 
      "target": { 
       "id": "887109751445971", 
       "url": "https://www.facebook.com/SairandhriShowroom/photos/a.302015823288703.1073741828.300462640110688/887109751445971/?type=3" 
      }, 
      "type": "photo", 
      "url": "https://www.facebook.com/SairandhriShowroom/photos/a.302015823288703.1073741828.300462640110688/887109751445971/?type=3" 
      } 
     ] 
     } 
    } 

其工作和測試的圖形API瀏覽器

+1

工作良好這裏,這應該是去正確awnser – GuiPab