开发者

How to post to the wall of a fanpage with the name of the fanpage

开发者 https://www.devze.com 2023-03-30 18:04 出处:网络
I\'m as User KDB the administrator of a fanpage TVWehen. Switiching to the account of TVWehen I can post to the wall and orgnaize events as TVWehen ( first heading in news is TVwehen )

I'm as User KDB the administrator of a fanpage TVWehen. Switiching to the account of TVWehen I can post to the wall and orgnaize events as TVWehen ( first heading in news is TVwehen ) Usin php I can post to the wall of TVwehen ($fanpageId contains the actual value of the page ) $news=array( 'access_token' => $access_token, 'page_id' 开发者_StackOverflow中文版 => $fanPageId, 'message' => $message, 'subject' => $name, 'caption' => 'Informationen aus dem Verein', 'description' => $description, 'picture' => $picture

);

$facebook -> api( $fanPageId . '/feed', 'POST', $news );

but the heading is not TVWehen but KDB If I switch to the acount of TVWehen and run the php program it fails with : "{"error":{"type":"OAuthException","message":"(#200) This post wasn't created by the application with req_perms I tried to autorize with any possible permission .

Who has an I idea about the error or has a solution to post to a fanpage in the name of the fanpage


In summary you need to use the page's access token.

From the Facebook documentation "you must use the Page's access token, not the user access token commonly used for reading Graph API objects. This access token can be retrieved by issuing an HTTP GET to /USER_ID/accounts with the manage_pages permission. This will return a list of Pages (including application profile Pages) to which the user has administrative access, along with access_tokens for those Pages. Publishing to a Page also requires the publish_stream permission, unless otherwise noted."

http://developers.facebook.com/docs/reference/api/page/

And you can find php code (for posting a video) on the June 18th Facebook developer blog entry.

http://developers.facebook.com/blog/post/515/#video_upload

0

精彩评论

暂无评论...
验证码 换一张
取 消