2017-03-29 119 views
1

我正在嘗試使用Graph API Explorer從Insights部分獲取有用的數據。如何從Facebook Insights API獲取結果

我試過不同的指標和日期,數據的結果總是空的。

我能夠看到我的頁面儀表板中的喜歡數量,並選擇一個範圍的基礎上,但我仍然沒有看到任何數據。

如果access_key是一個問題,它會返回一個錯誤如此說,或者只是返回空結果?

這裏是一個流行公司的調試輸出,我想過去幾週會有新的喜歡。

=== Query 
    curl -i -X GET \ 
    "https://graph.facebook.com/v2.8/14226545351/insights/page_positive_feedback_by_type?since=1487788679&until=1490812690&access_token=<access token sanitized>" 
=== Access Token Info 
    { 
    "perms": [ 
     "user_likes", 
     "manage_pages", 
     "pages_show_list", 
     "public_profile" 
    ], 
    "page_id": 167544343274096, 
    "user_id": "10152810337959467", 
    "app_id": 145634995501895 
    } 
=== Parameters 
- Query Parameters 

    { 
    "since": "1487788679", 
    "until": "1490812690" 
    } 
- POST Parameters 

    {} 
=== Response 
    { 
    "data": [], 
    "paging": { 
     "previous": "https://graph.facebook.com/v2.8/14226545351/insights?access_token=<access token sanitized>&pretty=0&since=1484764668&until=1487788679&metric=page_positive_feedback_by_type", 
     "next": "https://graph.facebook.com/v2.8/14226545351/insights?access_token=<access token sanitized>&pretty=0&since=1490812690&until=1493836701&metric=page_positive_feedback_by_type" 
    }, 
    "__debug__": {} 
    } 
=== Debug Information from Graph API Explorer 
- https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=14226545351%2Finsights%2Fpage_positive_feedback_by_type%3Fsince%3D1487788679%26until%3D1490812690&version=v2.8 

是否有人能夠舉一個實際的工作示例?我還沒有遇到過。

回答

2

我在Graph API瀏覽器中發現,當你生成一個訪問令牌時,你需要給它權限「read_insights」。

此外,這隻適用於您的帳戶可以訪問該給定對象的頁面。

不幸的是,該文檔在這方面非常模糊,並且沒有給出任何權限錯誤消息。

+0

關於「具有read_insights權限的頁面訪問令牌」可以檢索該頁面的所有度量標準「是什麼? https://developers.facebook.com/docs/graph-api/reference/v2.8/insights#reading – CBroe

+0

@CBroe根據每個屬性的定義,API文檔都是模糊的。我遇到的問題是由於無效的權限沒有錯誤消息。 – dardub

+0

我對含糊不清的東西很模糊。但是我發現通過所有的facebook圖形api文檔來查找我需要的內容令人沮喪。 – dardub

相關問題