Php facebook api图形张贴在群组墙上
有人能帮我吗? 我在我的组中尝试我的帐户,我是要发布的组的管理员。 如图 我有两个功能。贴在我自己墙上的帖子,没有错误 现在,我将讨论组帖子中的第二个函数。。 不幸的是,到目前为止还没有成功 函数2返回false作为响应 我的望远镜 用户组、发布操作、电子邮件、阅读流、发布流、用户照片、朋友照片、管理页面Php facebook api图形张贴在群组墙上,php,facebook,facebook-graph-api,Php,Facebook,Facebook Graph Api,有人能帮我吗? 我在我的组中尝试我的帐户,我是要发布的组的管理员。 如图 我有两个功能。贴在我自己墙上的帖子,没有错误 现在,我将讨论组帖子中的第二个函数。。 不幸的是,到目前为止还没有成功 函数2返回false作为响应 我的望远镜 用户组、发布操作、电子邮件、阅读流、发布流、用户照片、朋友照片、管理页面 function PostMessage(){ $postString = 'message='.rawurlencode($this->getMessage()).'
function PostMessage(){
$postString = 'message='.rawurlencode($this->getMessage()).'&uid='.$this->getUId().'&attachment='.urlencode($this->getAttachment()).'&'.$this->getAccessToken();
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://api.facebook.com/method/stream.publish");
curl_setopt($curl, CURLOPT_FAILONERROR, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postString);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($curl);
//print_r($response);
curl_close($curl);
}
function PostGroupMessage(){
$postString = 'message='.rawurlencode($this->getMessage()).'&uid='.$this->getUId().'&attachment='.urlencode($this->getAttachment()).'&'.$this->getAccessToken();
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://graph.facebook.com/".$this->getGroupId()."/feed"); // Neither group name nor the groups function id
curl_setopt($curl, CURLOPT_FAILONERROR, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postString);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($curl);
curl_close($curl);
}
编辑:
这是我发布运行之前对象的转储:
object(fb_send)#1 (6) {
["m_AppId":"fb_send":private]=>
string(15) "xxxx"
["m_SecretId":"fb_send":private]=>
string(32) "xxxx"
["m_UId":"fb_send":private]=>
int(xxxx)
["m_AccessToken":"fb_send":private]=>
string(56) "access_token=xxxx"
["m_Message":"fb_send":private]=>
string(101) "Besuchen Sie www.modelweb24.de - Die neue kostenlose social community für Fotografen und Fotomodelle!"
["m_Attachment":"fb_send":private]=>
string(258) "{"href":"http://www.modelweb24.de","name":"Wir begrüßen ","caption":"","description":"auf www.modelweb24.de","media":[{"type":"image","src":"http://www.modelweb24.de/ow_static/themes/OWD-Nyx/images/logofb.png","href":"http://www.modelweb24.de/"}]}"
}
然后我做PostGroupMessage,$response是boolfalse。
没有更多的错误
编辑2:
告诉我所有关于团体墙的消息
编辑3:
我已经发送了参数?method=POST,现在我变成了一个错误。 我错过了什么许可
{
"error": {
"message": "(#200) The user hasn't authorized the application to perform this action",
"type": "OAuthException",
"code": 200
}
}
创建应用程序时,所有人都需要拥有朋友的组访问权限,即朋友组和脱机访问权限
您可以在查看API是否有错误?我已经发送了参数?method=POST,现在我变成了一个错误。我错过了什么许可?{错误:{消息:200用户尚未授权应用程序执行此操作,类型:OAutheException,代码:200}}用户尚未授予您用户组和发布操作或发布流权限-您还在PostMessage中调用不推荐的API-我建议您检查当前文档,而不是使用任何示例或示例代码