Facebook API可以回复企业页面上的评论

时间:2019-04-24 07:26:00

标签: facebook-graph-api

我已完成所有设置,并且一切正常。我有一个弹出窗口,用户可以在其业务页面上回复评论。这也很好。

我的代码如下:

$url = "https://graph.facebook.com/v3.2/221454575852164769/comments";
$attachment =  array(
    "access_token"  => $page_access_token,
    "message"       => "Thank you so much!!",
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($attachment));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$comment = curl_exec($ch);
curl_close ($ch);
$comment = json_decode($comment, TRUE);

这很好。即使现在该脚本仍在工作,但问题是它返回此错误

Unsupported post request. Object with ID '221454575852164769' does not exist, cannot be loaded due to missing permissions, or does not support this operation

即使当我去Curl并在Facebook上查看评论后,评论也已成功发布。

有帮助吗?

1 个答案:

答案 0 :(得分:0)

从我标记的重复项中,您将看到您可能需要将您的应用程序提交给Facebook进行“应用程序审查”。

https://developers.facebook.com/docs/facebook-login/permissions/v3.0

How do I test a Facebook app since the recent introduction of login review?

要么您输入了一个参数/变量,要么输入了错误的18位ID号,因为它不能引用该对象的实例。