Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Graph API get all likes from a post

I am very new to facebook graph api, actually I just started today so I might use some help.

My code is working perfectly, I've written a simple algorithm to list people who like a certain post, but the problem is this. Here is the JSON reply I get from graph api:

<br/>
{<br/>
            "likes": {<br/>
            "data": [<br/>
               {<br/>
                   "name": "NAME",<br/>
                   "id": "ID"<br/>
               },<br/>
               {<br/>
                   "name": "NAME",<br/>
                   "id": "ID"<br/>
               },<br/>
               {<br/>
                   "name": "NAME",<br/>
                   "id": "ID"<br/>
               },<br/>
               {<br/>
                   "name": "NAME",<br/>
                   "id": "ID"<br/>
               }<br/>
           ],<br/>
  "count": 22<br/>
},<br/>
"id": "POST ID",<br/>
"created_time": "DATE CREATED"<br/>
}<br/>

so even though there are COUNT:22 Likes, the server returns only 4 names. Is it possible to get all the names? if so, how?

like image 908
cprogcr Avatar asked Mar 31 '12 11:03

cprogcr


1 Answers

You can run another query on the ID of the like object asking for details (i.e. /Likes?limit=99)

like image 111
Yoav Caspi Avatar answered Feb 04 '23 09:02

Yoav Caspi