javascriptfacebook-graph-apifacebook-javascript-sdkgraph-api-explorer

Putting the comment on a fb page


I am using js sdk to commment on every post which is being posted by any user on my FB Page. I made one app and one FB page. I put some posts on FB page but i am not able to comment on posts. I am using Graph API Explorer : https://developers.facebook.com/tools/explorer to test the functionality.

I have got the token with extended permission and then i tried :

page_id/feed?fields=id,from

I got all the posts and then i tried to the comment on a post using :

post_id/comments?message="Test Comment"

I got

{
  "data": [
  ]
}

which should instead return the comment id of new comment having message Test Comment.

Any Help will be highly appreciated !!


Solution

  • I got the solution, i was using GET request , instead use POST request

    post_id/comments?message=Test Comment.
    

    It will return the new comment ID.