2012-08-28 18 views
1

我試圖檢索JSON格式的許多頁面的「份額」圖數據。我懷疑我遇到的錯誤源於這樣的事實,即某些URL在其中包含逗號,並且正在被解析爲嘗試傳遞多個ID。facebook圖api返回錯誤2500時,在標識爲url的逗號中

返回圖形數據。
https://graph.facebook.com/?ids=http://celebritybabies.people.com/2012/08/23/backstreet-boys-howie-dorough-expecting-second-son/

返回錯誤2500「不能指定一個空標識符」
https://graph.facebook.com/?ids=http://www.people.com/people/article/0,,20624518,00.html

編碼逗號,仍返回2500
https://graph.facebook.com/?ids=http://www.people.com.people.article/0%2C%2C20624518%2C00.html

回答

2

似乎有沒有辦法周圍除了使用正常檢測

http://graph.facebook.com/http://www.people.com/people/article/0,,20624518,00.html

您可能需要在http://developers.facebook.com/bugs處提交錯誤,但我覺得答案很可能是「設計狀態」。

+0

如果你仍然想要一次查詢多個,這樣的調用可以[批量](https://developers.facebook.com/docs/graph-api/making-multiple-requests/)。 – joeln

0

你可以嘗試使用FQL代替,查詢link_stat表:

SELECT url, normalized_url, share_count, comments_fbid FROM link_stat 
    WHERE url = 'http://www.people.com/people/article/0,,20624518,00.html' 

See result in Graph API Explorer.)您也可以使用WHERE url IN ("…", "…", …)一次檢查多個網址。

這也返回10151022112466453一個comments_fbid,並一個你可以通過API查找,https://graph.facebook.com/10151022112466453

或許這可以作爲一個解決方法的工作,直到Facebook的修復此問題。