Question

I am managing an organisation's page on Facebook and want to like all posts made by the page from my personal account.(Let us say the posts from now on and not from the time the page was created) I have no idea how to proceed as I haven't explored facebook's developers tool. Can someone help a bit?

Was it helpful?

Solution

Well, its a very broad question. I dont know what language are you using and are you aware of graph api or not. So first of all go through the basics-

  • Using the Graph API
  • Access token - all API calls must be signed with an access token
  • Login - very important part i nfacebook integration, yet I think its not relevant to this question
  • Graph API Explorer- a tool provided by facebook to test the API calls. (first register on the developers site if you have not yet)

Now coming to the solution to the question-

  1. First of all you'll be needing the post IDs of the page. To query for all the posts-

    \GET https://graph.facebook.com/<Page-ID>/posts?fields=id
    

    Example to fetch all the public posts by "Aam Aadmi Party".

  2. Then, for each of that post id, you have to make a POST call to /likes, this will return true on success and the post will be liked.

    \POST https://graph.facebook.com/<Post-ID>/likes
    

    Example to like a post from the "Aam Aadmi Party" page.

Hope it helps. Good luck!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top