Facebook post impressions are null in FQL stream query

╄→гoц情女王★ 提交于 2019-12-03 14:52:26
Sahil Mittal

I think its missing in the documentation, but you should make this call using the page access token instead of user access token to get it worked.

So here are the steps:

  1. Get the following permissions from the user and get the user access_token:

    • manage_pages - to get the page access token
    • read_insights - to read the impressions (as mentioned in the doc)
    • read_stream - for all posts that the current session user is able to view

  2. Using that token, get the page access_token with the call-

    /{page-id}?fields=access_token

  3. (optional) Check out my answer here to extend this page access token that will never expire. (Basically to avoid some steps)

  4. Using the page access token, run your query-

    SELECT post_id, actor_id, message, impressions FROM stream WHERE actor_id = {owned_page} and source_id = {owned_page}

    This will fetch you the impressions(if any) in the result.

Hope that helps.!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!