Facebook API: Post likes edge has no total_count field - facebook

My query on the Facebook graph explorer is ..../175126819173613_796398493713106/likes?fields=total_count
Where the long number is a post id. For some reason, the post/likes edge only has a data field and the above query fails with:
{
"error": {
"message": "(#100) Unknown fields: total_count.",
"type": "OAuthException",
"code": 100
}
}
The reference says that each like edge should have a total_counts field so I'm not sure what I'm missing.

Old question but,
175126819173613_796398493713106/likes?summary=1&limit=0
gives
{
"data": [],
"summary": {
"total_count": 2
}
}

Related

PSID is unsupported GET request Graph API?

I'm trying to get labels associated with participants of conversations on my fb page.
My GET request: <pageID>/conversations?fields=participants,id&access_token=<PageAccessToken>
The POST:
{
"participants": {
"data": [
{
"name": "Jim Bean",
"email": "numbers#facebook.com",
"id": "2821512231253160"
},
{
<my page info>
]
},
"id": "<convo link>"
},
When I click on the participant's ID, I get the following error.
"message": "Unsupported get request. Object with ID '2821512231253160' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph...",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "AwlTn9Vx3mfPtRGnquaHm8k"
Thus, I cannot request labels associated with PSIDs without being able to get info on my user's PSIDs.
What am I missing? How can I retrieve PSIDs from conversations?

Facebook graph API search in group feed

According to Facebook graph API playground it is possible to search in a page/group feed ,
I'm using the following URL to do so:
https://graph.facebook.com/<group_id>/feed?q=<search query>&access_token=<access_token>
And this is the result i'm getting:
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1,
"fbtrace_id": "FVaffSuGwvg"
}
}
What is the problem here ?

Get facebook fans count using API 2.8

How to get Facebook fans count using http request in API 2.8
-- I test these requests but not working
This return an array but no Fans Count
https://graph.facebook.com/v2.8/{APP_ID}?access_token={ACCESS_TOKEN}&edges=fan_count
Return
{
"category": "Entertainment",
"link": {APP LINK},
"name": {NAME},
"id": {ID}
}
-- This throw an error array
https://graph.facebook.com/v2.8/{APP_ID}?access_token={ACCESS_TOKEN}&fields=likes
Return
{
"error": {
"message": "(#100) Tried accessing nonexisting field (likes) on node type (Application)",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "FlkGoTOJ403"
}
}
This is the correct one:
https://graph.facebook.com/v2.8/{PAGE_ID}?access_token={ACCESS_TOKEN}&fields=fan_count
Not sure why you would use an App for this, Fans are for Pages.
Use {PAGE_NAME} instead of {APP_ID}
GET ACCESS TOKEN: https://graph.facebook.com/oauth/access_token?client_id={APP_ID}&client_secret={APP_SECRET_KEY}&grant_type=client_credentials
GET FANS COUNT: https://graph.facebook.com/v2.8/{PAGE_NAME}?access_token={ACCESS_TOKEN}&fields=fan_count
Thanks for luschn

facebook FQL CONTAINS operator not working

Since yesterday morning the "CONTAINS" FQL function doesn't work for the application table.
For example, the query: SELECT link,display_name FROM application WHERE CONTAINS ('slot')
the result is: {
"error": {
"message": "(#200) Must have a valid access_token to access this endpoint",
"type": "OAuthException",
"code": 200
}
}
But for the user table query: SELECT first_name FROM user WHERE CONTAINS ('ben')
the result is: {
"data": [
{
"first_name": "Benjamin"
},
{
"first_name": "Benjamin"
},
{
"first_name": "Damon"
}...
There was no warning or notice about it from FB.
Any one knows what is the reason for that, and how can i search apps using the FB API?
Thanks

how to get facebook post after a graph search?

https://graph.facebook.com/search?access_token=xxxxxx&q=hello&type=post&fields=from,message,picture,link,name,caption,description,created_time&limit=1&locale=en_US&scope=publish_stream,offline_access,user_status,read_stream
After such a graph search, I get some data like:
{
"data": [
{
"from": {
"name": "Eric Fluegge",
"id": "100000626293694"
},
"message": "Well, here's go nothing. Hello Tennessee.",
"created_time": "2013-03-30T19:23:44+0000",
"id": "100000626293694_567340783296793"
}
],
"paging": {
"previous": "https://graph.facebook.com/search?fields=from,message,picture,link,name,caption,description,created_time&q=hello&limit=1&type=post&locale=en_US&access_token=XXXXXXXXXXXXX&since=1364671424&__previous=1",
"next": "https://graph.facebook.com/search?fields=from,message,picture,link,name,caption,description,created_time&q=hello&limit=1&type=post&locale=en_US&access_token=XXXXXXXXXXXXX&until=1364671423"
}
}
so, is "id": "100000626293694_567340783296793" a post id? If so, how to use this post id, query again, get only this certain post information? I would like to store post id to mysql table, then I want to query the post anytime in the future, thanks.
EIDT: in app setting, i have set the publish_stream,offline_access,user_status,read_stream
EIDT2:
I have tried into Graph API Explorer, choose read_stream and generate a long live token.
SELECT post_id, actor_id, message, type, attachment FROM stream WHERE post_id = "100000626293694_567340783296793"
the result still empty. so I cannot get a post bcause i am not a friend of the post auther? or 100000626293694_567340783296793 is not a post id? or other reason?
Yep, the "id": "100000626293694_567340783296793" is a post ID, you can query its data again with the following URL: http://graph.facebook.com/100000626293694_567340783296793
Attention!
You should ask for the read_stream permission/scope too! Or else you'll get the following error:
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
And of course, append the access_token to your GET url. (and don't forget https too)
You can check the Graph API Reference here: Post - Facebook Developer Reference