Php-graph-sdk: Graph returned an error: (#200) Requires publish_stream permission

Created on 19 Oct 2017  路  5Comments  路  Source: facebookarchive/php-graph-sdk

$permissions = ['email','publish_actions']; // Optional permissions
try {
// Returns a Facebook\FacebookResponse object
$response = $fb->post('/iduserxxx/feed', $linkData, $accessToken);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}

$graphNode = $response->getGraphNode();

echo 'Posted with id: ' . $graphNode['id'];

}

Graph returned an error: (#200) Requires publish_stream permission

Most helpful comment

@yguedidi I found the solution to this. The problem was i had to explicit ask for pusblish actions even if the app has already granted from facebook.

All 5 comments

Same here. The weird part is that this permission is deprecated.

Requesting a permission doesn't mean the user will grant it. So there, looks like the logged in user didn't grant the publish permission.

@yguedidi I found the solution to this. The problem was i had to explicit ask for pusblish actions even if the app has already granted from facebook.

@vaggelis2018 Can you tell me how you did it? HELP

@jakelinemartins Hello and sorry for the late response. I was using laravel socialite.

Was this page helpful?
0 / 5 - 0 ratings