facebook: permanent Page Access Token?

后端 未结 16 2090
情书的邮戳
情书的邮戳 2020-11-22 02:39

I work on a project that has facebook pages as one of its data sources. It imports some data from it periodically with no GUI involved. Then we use a web app to show the dat

16条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 02:53

    As all the earlier answers are old, and due to ever changing policies from facebook other mentioned answers might not work for permanent tokens.

    After lot of debugging ,I am able to get the never expires token using following steps:

    Graph API Explorer:

    1. Open graph api explorer and select the page for which you want to obtain the access token in the right-hand drop-down box, click on the Send button and copy the resulting access_token, which will be a short-lived token
    2. Copy that token and paste it in access token debugger and press debug button, in the bottom of the page click on extend token link, which will extend your token expiry to two months.
    3. Copy that extended token and paste it in the below url with your pageId, and hit in the browser url https://graph.facebook.com/{page_id}?fields=access_token&access_token={long_lived_token}
    4. U can check that token in access token debugger tool and verify Expires field , which will show never.

    Thats it

提交回复
热议问题