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

前端 未结 2 1317
無奈伤痛
無奈伤痛 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条回答
  •  不知归路
    2020-12-07 00:53

    See https://developers.facebook.com/docs/roadmap/completed-changes/offline-access-removal/ - specifically Scenario 5 -

    1. Use the server-side Oauth flow (see the Login docs for details) to obtain the access token for the page admin (which has manage_pages permission)

    2. Retrieve the Page Access token you retrieve from /me/accounts or /?fields=access_token.

    This Page access token will have infinite expiry, meaning it won't expire unless unless the user stops being an admin of the page, removes your app, kills all their app sessions, etc.

提交回复
热议问题