I have to convert some FQL into Graph2.1 http requests.
The fql
select post_id, likes from stream
where source_id = {page_username} and filter_key='owner' limit 1000
This returns the post ids and the likes to that post for any page I can enter for the {page_username}. The likes is an array that contains a "count" key value pair.
The issue is when I use the new 2.1 I can't get a total count of likes for the post.
GET /v2.1/{page_username}?fields=posts{id,likes} HTTP/1.1
Host: graph.facebook.com
I can only get an array of users that have liked the post. The issue is it's paginated also so it's not a complete list.
The refrence says there's a "total_count" field. Facebook Graph Reference
GET /v2.1/{page_username}?fields=posts{id,likes{total_count}} HTTP/1.1
Host: graph.facebook.com
But this returns an error
"error": { "message": "(#100) Unknown fields: total_count.", "type": "OAuthException", "code": 100 }
Any ideas on how I can get just a like count for a post?