facebookfacebook-graph-apifacebook-insights

Facebook Graph API (#190) This method must be called with a Page Access Token


I get data from the Facebook insights via Facebook Graph API more than year. And recently started all my requests (like {id}/insights) to return with an error: (#190) This method must be called with a Page Access Token. But the Access token contains scopes manage_pages,read_insights. Any ideas?


Solution

  • manage_pages,read_insights

    This will give a user access_token , that u can use to manage pages & check insights,

    But a page token became required for any /insights endpoint since 5th feb 2018

    Use your manage_pages scope & user_token to get a Page access token

    Send a get request to this endpoint

    GET /{page-id}?fields=access_token 
    

    Output

    {
      "access_token": "{your-page-access-token}",
      "id": "{page-id}"
    }
    

    You can use the returned access token to call /insights endpoint now.