Post to Facebook Page wall using RestFB api

前端 未结 4 718
攒了一身酷
攒了一身酷 2021-01-13 21:06

I am trying to post on the wall of a facebook page. I am able to post on the user wall using App Access token.

I got the App Access Token through extending the Defau

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-13 21:50

    The App Access Token is the most basic one, and will not allow you to post anything. In order to post something to a Facebook Page (as a Page), you need to get a Page Access Token.

    The process is a bit complicated, because you actually need to authorize the user with the "manage_pages" permission first, with the User Access Token you can call the API to get a Page Access Token (/me/accounts).

    See those links:

    • https://developers.facebook.com/docs/facebook-login/
    • https://developers.facebook.com/docs/facebook-login/access-tokens/
    • http://www.devils-heaven.com/facebook-access-tokens/

    Btw, the REST API is deprecated: https://developers.facebook.com/blog/post/616/

    You can also try the "Client Token" (Developer Settings > Advanced), i never worked with that one but it could be the easiest solution. In any case, an App Access Token is the wrong one.

提交回复
热议问题