Search code examples
facebookfacebook-graph-apifacebook-likefacebook-comments

Like and comment a Post on a Page with Open Graph API


to evaluate the title of the question, I have created a page. And also app for getting a appID.

i have posted a like(action) on a techcrunch article(Object) on my timeline with the mention of my FB app name. But, is it possible to let users of my website like & comment a particular post , which the admin posted to public on my Page using graph api.

how can we get access tokens for users to do so ?

would we still need app ID. even if it is about the facebook page. ?


Solution

  • Yes you can create Like and Comment over a particular Post. And to do so you would be required to have a Facebook app and get User's authorization for publish_stream permission. After that you can create Like for a particular Post by making a HTTP POST request to

    POST_ID/comments
    

    with message field and would return comment_id as success. And like by making HTTP POST to

    POST_ID/likes
    

    which would return true as success on creation of like.