0

I'm developing an application which allows customers to share a link to their Facebook using FB.ui, it's something like this

FB.ui(
{
    method: 'feed',
},
function (response) {
    // the response contains only post_id
    if (response && response.post_id) {
        // do something
    }
});

An example for post_id I got: 1329761410442716_1330464870372370

I'm trying to get like counts of this post using

https://graph.facebook.com/1329761410442716_1330464870372370/likes?summary=true&access_token=MY_ACCESS_TOKEN

Facebook returns message: singular statuses API is deprecated for versions v2.4 and higher

I can get the like count with API v2.3 with that post_id, however my app is using API v2.9

Please show me the way, thanks.

1 Answers1

0

I think you need the /reactions edge for /posts. Have a look into the Graph API Reference, there's also a field for summary.

So that's basically the way to go (did not test this one yet, cause the Graph API Explorer is not working at the moment):

https://graph.facebook.com/{post-id}/reactions?summary=total_count&access_token={access-token}
trotta
  • 1,232
  • 1
  • 16
  • 23