Search code examples
facebookfacebook-graph-apifacebook-javascript-sdk

Find out which user commented or reacted to a post on your feed


I am looking at the Facebook Graph API docs, specifically for

/{post-id}/comments
/{post-id}/reacts
/{post-id}/likes

I am trying to figure out if I can determine which user commented/reacted/liked a post that I posted on my wall/feed.

According to these docs, I can't figure out if this is possible? does anyone know?

https://developers.facebook.com/docs/graph-api/reference/v3.2/object/comments https://developers.facebook.com/docs/graph-api/reference/v3.2/object/likes https://developers.facebook.com/docs/graph-api/reference/v3.2/object/reactions

if it's not clear...all I really want to do here is get the user-id of the user that liked/commented on/shared/reacted to, a post that I posted (I being the logged in user to the graph api).


Solution

  • I tested this just be sure: There is no way to get a user id if the user in question did not authorize your App. So, the reactions and likes endpoint would just return an empty array, and the comments endpoint would just return data that is not specific for that user.

    For example, the response for reactions of a Page Post that definitely has reactions and is public without any restrictions - the App being used even got "Page Public Content Access" approved:

    {
      "data": [
      ],
      "paging": {
        "cursors": {
          "before": "...",
          "after": "..."
        },
        "next": "..."
      }
    }