2017-02-15 95 views
0

我想使用Graph Api查詢在Graph Api Explorer的帖子ID獲取帖子的文本。我正在嘗試;使用Graph Api Explorer獲取帖子的文本

GET/v2.8/{14346289902472_1788429604532785} 

GET/v2.8/{14346289902472_1788429604532785} HTTP1.1 

的文件說; enter image description here

但都提示錯誤;

{ 
    "error": { 
    "message": "(#803) Some of the aliases you requested do not exist: {14346289902472_1788429604532785}", 
    "type": "OAuthException", 
    "code": 803, 
    "fbtrace_id": "AKd65t6sFzI" 
    } 
} 

{ 
    "error": { 
    "message": "Unknown path components: /1.1", 
    "type": "OAuthException", 
    "code": 2500, 
    "fbtrace_id": "DbFPezM2JiA" 
    } 
} 

我怎樣才能得到使用後ID後的文本?

編輯1

enter image description here

回答

0

您正在試圖得到一個單一的飼料項目。

GET https://graph.facebook.com/v2.8/143462899029472/feed?id=1788429604532785 



{ 
    "error": { 
    "message": "(#12) singular statuses API is deprecated for versions v2.4 and higher", 
    "type": "OAuthException", 
    "code": 12, 
    "fbtrace_id": "CJpKkf7emZS" 
    } 
} 

圖形API不允許你這樣做。

只要得到飼料GET https://graph.facebook.com/v2.8/143462899029472/feed並迭代結果,直到找到你想要的。如果你沒有在第一組中找到它,然後分頁並在下一組中找到它。

+0

那麼如何獲得發佈文字? – Humty

+0

我在最後加了一點,可以幫助你做你想做的事。 –

1

你是從哪裏得到這個ID的?

參觀https://www.facebook.com/14346289902472_1788429604532785重定向到https://www.facebook.com/ImranKhanOfficial/posts/1788429604532785,當您通過API查找的頁面名稱ImranKhanOfficial,你會發現它的頁面的id 143462899029472

所以
14346289902472
而不是
143462899029472

而且一旦你使用作爲「前綴」的文章ID,它工作完全正常:https://developers.facebook.com/tools/explorer?method=GET&path=143462899029472_1788429604532785&version=v2.8

相關問題