Which Facebook permissions allow for posting to a page wall (not profile wall)?

后端 未结 2 731
不知归路
不知归路 2020-12-05 01:04

I am working on a project to post data to the walls of Facebook pages. I have set up a Facebook app and currently requesting the following permissions from user when attemp

2条回答
  •  暖寄归人
    2020-12-05 01:14

    here's what you do. First, read the documentation on extended permissions. Notice that 'manage_pages' says:

    Enables your application to retrieve access_tokens for pages the user administrates. The access tokens can be queried using the "accounts" connection in the Graph API. This permission is only compatible with the Graph API.

    This means you have to switch your user's access token based on the response from the

    https://graph.facebook.com/$USERID/accounts?access_token=$USER_ACCESS_TOKEN
    

    for your app. So once you have your PAGE ACCESS TOKEN, switch the request to post your message like such:

    https://graph.facebook.com/$PAGEID/feed
    

    in postfields (using curl or some such), include your message and $PAGE_ACCESS_TOKEN

提交回复
热议问题