2012-04-25 75 views
0

我想通過API使用考拉紅寶石gem來更新facebook業務頁面的地址/位置,到目前爲止還沒有工作解決方案。如何通過API更新Facebook頁面的地址

page_access_token = "gw4t3434" 
page_api = Koala::Facebook::API.new(page_access_token) 
page_api.graph_call('me', {:location => {:street => "my street"}}, 'post') #error. Koala::Facebook::APIError: OAuthException: (#100) Parameters do not match any fields that can be updated 
page_api.graph_call('me', {:location => {:address => "my street"}}, 'post') #error. Koala::Facebook::APIError: OAuthException: (#100) Parameters do not match any fields that can be updated 
page_api.graph_call('me', {:address => "my street"}}, 'post')# not raise error but not working 
page_api.graph_call('me', {:street => "my street"}}, 'post')# not raise error but not working 

我找不到在facebook api reference有關更新頁面中的地址的明確解釋。我可能會錯過一些東西...

回答

2

您不能寫入位置對象,只能讀取。請參閱API中的「Updating Page Attributes」。此外,沒有權限請求寫入位置對象。

另一種方法是,您寫入Page的about部分 - 這是允許的。也許你可以在這裏放置一個地址引用來滿足使地址變更對最終用戶可見的要求。

相關問題