2014-04-30 48 views
0

請求Facebook帖子時,是否可以將定位查詢傳遞給圖形api? 如果是這樣,應該怎麼做?在頁面帖子查詢中提供定位過濾

我發現這個問題:

How to specify location targeting of FB post via Graph API

而這一次

Geotargeting Page Posts with the Facebook API

但它似乎沒有工作,我一直試圖在圖形瀏覽器中的以下。 以及更多的排列。

PAGE_ID/posts?fields=targeting({'countries' : ['DE'] }) 
PAGE_ID/posts?fields=targeting("{'countries' : ['DE'] }") 
PAGE_ID/posts?targeting={'countries' : ['DE'] } 
PAGE_ID/posts?targeting={countries : ['DE'] } 
PAGE_ID/posts?targeting="{'countries' : ['DE'] }" 
PAGE_ID/posts?targeting="{countries : ['DE'] }" 

有了所有這些查詢,我總是得到非過濾結果或錯誤。

有沒有一個正確的方法來做到這一點,有沒有可能在任何地方的任何文件?

回答

0

您不能使用像您在Graph API中發佈的查詢限定條件。 targetingfeed_targeting字段在發佈帖子時設置(https://developers.facebook.com/docs/graph-api/reference/page/feed#pubfields)。

什麼,你可以嘗試使用FQL流表來獲得具有一定目標職位:

select post_id from stream where source_id={page_id} and feed_targeting.country in ('DE') 

一定要注意訪問限制:

要讀取流表你需要當前會​​話用戶能夠查看的所有 帖子的read_stream權限,read_insights 有權查看當前會話用戶所擁有的由Page歸屬的 所發佈帖子的帖子展示次數。