Answer the question
In order to leave comments, you need to log in
How do I autopost to Facebook on behalf of a Group?
$linkData = [
'link' => 'http://www.yandex.ru',
'message' => 'User provided message',
];
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post('/293458671047285/feed', $linkData, $_SESSION['fb_access_token']);
} 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;
}
Answer the question
In order to leave comments, you need to log in
You can't post on behalf of a group, you can't even do it through Facebook.
You do not confuse the case with the page?
In order to post to a Facebook page, you need to get a list of accounts.
You make a GET /me/accounts call, each will have its own token in the results.
Switch to the desired token through the setDefaultAccessToken() method, and POST /me/feed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question