I'm trying to publish a post to fbk Page.
1) The fbk Page owner is not me, so through facebook Business Manager I got the role of administrator
2) In Facebook Developer I've created new fbk app and the settings have been defined
3) In https://developers.facebook.com/tools/explorer/ I've requested the User Token (by flagging all permissions), and extended its duration (button Extend in https://developers.facebook.com/tools/debug/ )
4) In https://developers.facebook.com/tools/explorer/ I've requested the Page Token and extended its duration too
5) I’ve verified the domain in https://business.facebook.com/ > Business Manager settings > Brand Safety tab > Domains > Add > example.it and I verified it using HTML file
6) I’ve assigned the page in https://business.facebook.com/ > Business Manager settings > Brand Safety tab > Domains > select domain example.it > Pages > Assign page > EXAMPLE
Finally this is the code used on my website to posted news. Without 'picture', 'link' and 'description' seems to work fine and return the post id:
“Posted with id: 1234561425917649_1234565412555243”
$page_access_token = “XYZ123”;
$fb = new Facebook\Facebook([
'app_id' => '123456789012345',
'app_secret' => '1a1a1a1a1a1a1a1a1a1a1a1a1a1a”
'default_access_token' => $page_access_token,
'default_graph_version' => 'v3.2'
]);
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post('/me/feed', [
'message' => 'Text - message',
'name' => ‘Text - name’,
'picture' => 'http://www.esample.com/images/logo.png',
'link' => 'http://www.example.com/page.php',
'description' => 'Text - description,
]);
} 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'];
Otherwise provides the error "Graph returned an error: (# 100) Only owners of the URL have the ability to specify the picture, name, thumbnail or description params."