facebook access token is invalid - trying to post to facebook website-“page” via app using a cron

前端 未结 2 1312
無奈伤痛
無奈伤痛 2020-12-07 00:06

I am trying to post to my website\'s Facebook fan-page via a cron on my server.

I created a user on Facebook named \"John Doe\", i made him admin on my website\'s Fa

2条回答
  •  -上瘾入骨i
    2020-12-07 00:51

    This question is very similar to my own question and I've spent 2 days trying to solve this. The solution is super simple.

    1. Set your app to Native/Desktop so you can get a 60-day token (you'll turn this to permanent later). Do this by going to https://developers.facebook.com/apps/ Edit settings > Advanced > Choose Native/Desktop in the App type.

    2. Go to https://developers.facebook.com/tools/explorer/ select your app, and Get Access Token

    3. In the Extended Permissions tab, select manage_pages and publish_stream

    4. Now you have a 60-day temporary token.

    5. To get your permanent token, go here and use your temporary token: https://graph.facebook.com/me/accounts?access_token=REPLACE_THIS_WITH_YOUR_TEMPORARY_TOKEN

    You should see permanent access token to all Facebook pages which you are an admin

提交回复
热议问题