Olivier
Olivier

Reputation: 1269

Graph Api: Post to my page feed as a user, NOT as the page

I've been struggling with the graph api since this morning.

I'm trying to post a message to my facebook page, but NOT as the page, as myself (user).

When i try to post to a friend's page everything works fine and the message is posted, but when i try to post to my page (i'm an admin) it asks for manage_pages permission, and if i give this permission it will only post the message AS the page, not as myself !

Is there a way to specify that: yes i want to post to my page's wall, yes i'm the admin, but i want to post as a user ?

public function postToWall($pageId, $msg) {
    if($pageId) {
        $this->callAPI('/'.$pageId.'/feed', 'POST', array(
            'message' => $msg
        ));
    }
}

/**
 * @param $path
 * @param string $method default to GET
 * @param array $params additional params
 * @return mixed
 */
public function callAPI($path, $method = 'GET', $params = array()) {
    $params = array_merge(array('access_token' => $this->getAccessToken()), $params);
    return $this->api($path, $method, $params);
}

It returns:

Uncaught OAuthException: (#283) Requires extended permission: manage_pages

I've checked and the access_token is my user access token.

I have the "publish_stream" permission.

Any help would be appreciated ! Thanks

Upvotes: 9

Views: 3592

Answers (2)

raevilman
raevilman

Reputation: 3269

Try requesting 'publish_actions' permission. Also make sure you are using page as user not page itself on the Facebook.

Upvotes: 0

Boogeroos
Boogeroos

Reputation: 104

In FB docs You can read about publish_stream:

"Enables your app to post content, comments, and likes to a user's stream and to the streams of the user's friends."

So this permission cant give Your app access to publish on page wall. You must use "manage_pages" permission. Here is more information:

https://developers.facebook.com/docs/reference/login/page-permissions/

Upvotes: -2

Related Questions