开发者

Facebook Graph API POST to a comment to a Stream object

开发者 https://www.devze.com 2023-02-03 00:52 出处:网络
I\'m trying to post a comment to a status post on facebook.I\'ve figured out how to \"like\" existing comments using the following code:

I'm trying to post a comment to a status post on facebook. I've figured out how to "like" existing comments using the following code:

$status = $facebook->api("/$id/likes", 'post');

How would I modify the code to post a comment to 开发者_StackOverflow中文版this status message instead of like.

I've tried this: $status = $facebook->api("/$id/stream", 'post', "$comment");

but it returns this error: Invalid argument supplied for foreach()

I've also used "/$id/comments" instead of "/$id/stream", same error.


$facebook->api('/'.$POST_ID.'/comments','post',array('message' => $comment)); works for me. Make sure that you have publish_stream permissions and that you provide a proper Post ID of the status message.

0

精彩评论

暂无评论...
验证码 换一张
取 消