Retrieving photo likes through Facebook's Graph API - facebook

I want to store information about photos of Facebook pages.
I use for example this call to the graph API: https://graph.facebook.com/328548953909061/albums?fields=count,id,name,cover_photo,type,photos{id,name,created_time,picture,source,link,likes}&$acces_token
Since a couple of weeks I get this error:
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
When I remove ",likes" from the url it works. Anyone knows what is going wrong here?

In your initial call you need add v2.1
https://graph.facebook.com/v2.1/328548953909061/albums?...
Additionally I would call the following.
https://graph.facebook.com/v2.1/328548953909061/albums?fields=count,id,cover_photo,type,photos{id,name,created_time,picture,source,link,likes.summary(true).filter(stream)}&access_token=...
Adding .summary(true) and .filter(stream) to the likes field will give you a Summary doc in the photo doc and Filter will force all the nodes in to the count. Facebook "hides" some nodes of low "Top Story" value.

Related

Get facebook album give error code 100

I use simple app but cannot understand next:
Opened 2 urls:
https://www.facebook.com/media/set/?set=a.675416519138045.1073741830.660049570674740&type=3
AND
https://www.facebook.com/joyasmariajose.valdivieso/media_set?set=a.383620231706322.80737.100001750452794&type=3
When I use Graph Exploder:
GET \675416519138045
return all information about album in this user
But When I try
GET \383620231706322
I can get only user_id and name. On the album have next error:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"fbtrace_id": "Hb9lKBi2Wpz"
}
}
Question: What can be wrong with second url ?
Unsupported get request usually means that you can't access that resource without an Access Token, i.e. you don't have permissions to this object, as #CBroe said.

Facebook Graph API : get satuses with photos on user's feed

I'm trying to get user's own posts on with images on his feed.
GET https://graph.facebook.com/USER_ID/photos/uploaded
will get me the uploaded images but without the status they were posted on.
on the other hand,
GET https://graph.facebook.com/USER_ID/feed?fields=message
will work just fine , but
GET https://graph.facebook.com/USER_ID/feed?fields=message,attachments
is returning me this
{
"error": {
"type": "http",
"message": "unknown error",
"status": 500
}
}
(FYI as for v2.1 FQL is deprecated)
help?
To my knowledge, you have to do USER_ID/feed and then filter out the posts that aren't images. In those kinds of objects, there is no attachment field. There isn't any way of filtering content in Graph API like you could do in FQL. You would have to get the post type which I'm pretty sure is the field type.

Facebook API Video Views

I want to get the views of a video on my Facebook page.
My request:
{object-id}/insights/post_video_views_organic
But instead of data I get the following error back:
{
"error": {
"message": "(#100) Tried accessing nonexisting field (insights) on node type (Video)",
"type": "OAuthException",
"code": 100
}
}
I havenĀ“t really worked with the Facebook API in the past so I cant really translate this error message.
(I am using the Graph API Explorer)
Try adding the id of your facebook page (which you can retrieve through the Graph API or here) to the start of the object id, followed by an underscore ('_') then the object id of the video.
Instead of "{object-id}/insights/post_video_views_organic".
Use "{post-id}/insights/post_video_views_organic" . You will get the metrics.
The "post-id" is post id of that video post.

facebook api get page ratings return Unsupported get request

I already followed instructions from this https://developers.facebook.com/docs/graph-api/reference/v2.0/page/ratings
some config I have already made, this has been run only in facebook graph explorer
using page_access_token from me/accounts which is a required just want to post this
the field=open_graph_story and other fields
age restrictions changed back and forth
country restrictions changed back and forth
still having the same problem.
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
Is there something to do with the selected developer only to use this api? I have read something like that in the facebook api but failed to locate the url.
Any details about this problem, please, at least refer me some links.

FB Graph API: Get id of a page with a country restriction

Is it possible to get the Page ID of a page that has country restrictions?
Usually if I do something like http://graph.facebook.com/google
I'll get a response object with a bunch of info (incl. the id).
However doing http://graph.facebook.com/[page_with_country_restriction] returns:
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
Yes. It's possible to get the information of a page with country restrictions. You just need a valid Access Token for that.
Try making a request to the URL using that Access Token. Something like:
https://graph.facebook.com/teabeauty?access_token={Access_Token}
You can always make use of Graph API Explorer to test your requests and queries.