Facebook post responses equal to zero in FQL flow request

According to the FQL Stream documentation , the following query should return the number of impressions when the owner starts the authenticated page, but he never does it. We have a page owner who authenticates directly in the graphical api explorer with advanced permissions (read_stream, read_insights), but the number of impressions is always zero.

Can anyone make this work?

SELECT post_id, actor_id, message, impressions FROM stream WHERE actor_id = {owned_page} and source_id = {owned_page} 
+6
source share
1 answer

I think it is lacking in the documentation, but you should make this call using the page access token instead of the user access token in order for it to work.

So here are the steps:

  • Get the following permissions from the user and get user access_token :

    • manage_pages - to get the page access token
    • read_insights - read readings (as indicated in the document)
    • read_stream - for all messages that the current session user can view

  • Using this token, get page access_token with a call

    /{page-id}?fields=access_token

  • (optional) Check my answer here to extend the access token on this page, expiration never . (Basically, to avoid some steps)

  • Using the page access token, run your request -

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

    This will display the results (if any) in the results.

    enter image description here

Hope this helps.!

+4
source

Source: https://habr.com/ru/post/920319/


All Articles