如何修复“不支持的帖子请求”发布到FB粉丝页面? [英] How to fix "Unsupported post request" when posting to FB fan page?
问题描述
我有一个可以执行ff的脚本:
I have a script which can do the ff:
- 发布用户时间轴/墙的链接
- 以管理员身份发布用户页面的链接
发布到用户的个人资料页面工作正常。但是,发布到粉丝页面的行为很奇怪,我可以发布,但是我会收到不支持的发布请求错误。
The posting to a user's profile page works fine. However, the posting to a fan page is acting weird, I am able to post but I get back the "Unsupported post request" error.
我已经搜索了有关这个问题,并尝试所有的解决方案,但仍然我得到这个错误。我尝试了PHP 4.0.0 SDK和PHP 3.2.3 SDK,同样的错误。
I've searched SO about this problem and tried every solution offered but still I get this error. I tried both the PHP 4.0.0 SDK and PHP 3.2.3 SDK, same error.
以下是使用SDK 3.2.3的代码摘录:
Here is an excerpt of my code using SDK 3.2.3:
$ret_obj = $this->fb_obj->api("/{$page_id}/feed", 'POST',
array(
'link' => $link,
'message' => $message,
));
if($ret_obj){
return $ret_obj['id'];
}
return false;
这里是我使用SDK 4.0.0的代码:
While here is my code using SDK 4.0.0:
$response = (new FacebookRequest(
$session, 'POST', $edge, array(
'link' => $link,
'message' => $message,
)
))->execute()->getGraphObject();
if($response){
return($response->getProperty('id'));
}
return false;
对于权限范围,我使用ff =>'email','user_about_me' offline_access','publish_stream','publish_actions','manage_pages','user_photos','user_groups'。
As for scope of permissions, I use the ff => 'email','user_about_me','offline_access','publish_stream','publish_actions','manage_pages','user_photos','user_groups'.
有没有人遇到这个问题?
Has anyone encountered this problem?
推荐答案
错误提示您的应用仍处于测试/沙箱模式。将您的应用程序公开,然后您应该能够进行API调用。
The error suggests that your app is still in testing / sandbox mode. Make your application public and then you should be able to make the API call.
这篇关于如何修复“不支持的帖子请求”发布到FB粉丝页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!