Using the Facebook PHP SDK to post from Group
I'd like to use the Facebook PHP SDK to post on a user's wall FROM a group (i.e. not as a Status Update, from the user via an external app, but from a group via开发者_Python百科 an external app). I'm having a difficult time finding docs on the topic, and would like a code example as well as any information regarding any restrictions (e.g. can a group post on one's wall if the user does not belong to the group).
I've tried using the 'from' parameter, like this:
$attachment = array(
'access_token' => $access_token,
'message' => "Message from the group",
'name' => "Name of the Post",
'from' => array(
'name' => "Sender's Name",
'id' => "#############"
),
'link' => "http://myurl.com/",
'description' => "Description of the Posting",
'picture'=>"http://myurl.com/mylogo.png",
);
$ret_code=$facebook->api('/'.$fb_id.'/feed', 'POST', $attachment);
While posting as a "Page" is totally possible by getting a page access_token
, I've never seen anything similar for Facebook groups. So I would assume that this is NOT possible.
精彩评论