代表我的粉丝专页在墙上写字
我正在编写一个应用程序,它必须代表我的 FB 粉丝页面在墙上发布一条消息。
$facebook = new Facebook(array(
'appId' => 'xxx',
'secret' => 'xxx',
));
$facebook->api("/100002240625255/feed", 'POST', array(
'message' => 'tu wiadomosc'
));
有效,但作者是表条目的所有者,而不是粉丝专页。还有人有解决办法吗。
I am writing an application that has to publish a message on the wall on behalf of my FB fanpage.
$facebook = new Facebook(array(
'appId' => 'xxx',
'secret' => 'xxx',
));
$facebook->api("/100002240625255/feed", 'POST', array(
'message' => 'tu wiadomosc'
));
works, but the author is the owner of the table entries and not fanpage. Does anyone else have a solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须通过调用以下命令向粉丝专页的管理员之一授予 management_pages 权限:
使用您收到的令牌,您可以通过调用以下命令获取具有关联访问令牌的当前用户的粉丝专页:
然后您最终可以作为通过致电
您可以在此处找到教程:
https://developers.facebook.com/docs/authentication/
在页面登录下
You have to give a manage_pages permissions to one of the admins of the fanpage, by calling:
With the token you receive, you can fetch the current user's fanpages with associated access tokens by calling:
Then you can finally post to the fanpage's wall as a fanpage by calling
You can find the tutorial over here:
https://developers.facebook.com/docs/authentication/
under Page Login
您可以使用 Piotr Zawadzki 答案,但我建议您在使用您的用户访问令牌生成页面访问令牌之前,请首先确保使用您的扩展访问令牌,例如在 PHP 中使用以下代码:
这将允许您为页面创建永不过期的令牌。
You could use Piotr Zawadzki answer but I would recommend you to, before generating the page access token with your user access token, please, first be sure to use your Extended Access Token, for example with the following code in PHP:
This would allow you to create a non-expiry token for pages.