Aneesh
Aneesh

Reputation: 599

Facebook Graph API Object Likes not retrievable

I created a sample app on facebook and created a story called "UserX sampleactioned a sampleobject via sampleapp", where sampleobject is an app owned object. I then create an instance of the object using the FB graph api explorer like so:

<Using App Access Token>

https://graph.facebook.com/v2.1/app/objects/testapp:sampleobject
POST OBJECT:
{"app_id":my_app_id,"type":"testapp:sampleobject","url":"https://www.google.com","title":"Sample Object,"image":some_image)url,"description":"Some random description"}

The result of the above action is that I get an Object ID. Lets say 123456.

Then I post this on a test users timeline using the graph api explorer as follows:

<Using Test Users Access Token>

https://graph.facebook.com/v2.1/me/testapp:sampactioned?sampleobject=123456

This posts on the test users timeline.

Then i go ahead and login as test user on FB and like and comment on this object.

Then I come back to graph api explorer and try to retrieve the object likes and comments like so:

<Using App Access Token>
https://graph.facebook.com/v2.1/123456/likes

https://graph.facebook.com/v2.1/123456/comments

This action always returns a blank array like this:

{
  "data": [
  ]
}

What am I doing wrong?

Upvotes: 1

Views: 451

Answers (1)

Bryan Hazelbaker
Bryan Hazelbaker

Reputation: 81

Try using this format instead: https://graph.facebook.com/v2.1/123456?fields=likes.summary(true)

Upvotes: 2

Related Questions