Facebook API回复商业页面上的评论

问题描述 投票:0回答:1

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

我的代码看起来像这样:

$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上查看评论也成功发布了。

有帮助吗?

facebook-graph-api
1个回答
0
投票

从我标记的副本中,您将看到您可能需要将App App的应用程序提交给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号,因为它不能引用该对象的实例。

© www.soinside.com 2019 - 2024. All rights reserved.