pablobarbera / Rfacebook

Dev version of Rfacebook package: Access to Facebook API via R
http://cran.r-project.org/web/packages/Rfacebook
350 stars 250 forks source link

getPost doesn't return likes object #181

Open mkmetko opened 6 years ago

mkmetko commented 6 years ago

With both devtools and stable version, I get only post and comments objects, likes are not retrieved. I understand that personal parts (First and Last name) are missing, I need only anonymized data. Is it still possible to get likes for specific posts?

nlch commented 6 years ago

Hi @mkmetko ,

this is the issue I opened and closed a while ago about the missing likes table in the getPost request. Basically, Facebook has begun to authorize this edge only to page owners. So you can't get the users' name or id (so no likes) unless you use a page token associated to an admin of the page. The most you can get is the aggregated reactions with the getReactions function i guess.

If you do have admin access to the page, here's a link on how to get the token: link With this page token you should get the likes (also all reactions with user ids/names). There's also a new endpoint available that gives you access to ALL posts made in your page (no function for that in Rfacebook yet but you can use it with a simple modification in the getPages function by changing how you build the url)

From Graph Api Reference: "On February 5th, 2018, User information will not be included in responses unless you make the request with a Page access token. This only applies to Comments on Pages and Posts on Pages." link2