Facebook Graph API POST for comment on Stream object

I am trying to post a status message comment on facebook. I figured out how to β€œlike” existing comments using the following code:

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

How can I change the code to post a comment on this status message, not how.

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

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

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

+4
source share
1 answer

$facebook->api('/'.$POST_ID.'/comments','post',array('message' => $comment)); works for me. Make sure that you have publish_stream permissions and that you specify the correct status message identifier.

+8
source

Source: https://habr.com/ru/post/1334249/


All Articles