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

前端 未结 2 717
慢半拍i
慢半拍i 2020-12-10 18:22

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:

2条回答
  •  清歌不尽
    2020-12-10 19:01

    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.

提交回复
热议问题