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 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With