Facebook API Video Views - facebook

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.

Related

Getting Facebook Album Photo's on External Website using Graph API

I'm trying to get Facebook album data on a site, using the Facebook Graph API.
I'm trying to do so via Ajax or Postman but I can't get it to work.
I can make a normal https://graph.facebook.com/me call and get my name (i.e. this shows that I got the proper access token in Postman and can see the JSON).
It's when I try to do a call to get the JSON for the album that I get this error below (again the access token is there like the call above)
From the URL, I get the ID of the album:
https://www.facebook.com/amir.sobhi.94/media_set?set=a.693877XXx02412.100004404098018&type=3
and the error was ...
{
"error": {
"message": "Unsupported get request. Object with ID '693877XXx02412' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"fbtrace_id": "DHWlSshJtTU"
}
}

Retrieving photo likes through Facebook's Graph API

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.

Facebook Graph API - Retrieve photo - Unsupported get request

I am testing the Facebook Graph API via their explorer. I managed to get my feed using me/home. However, I want to get some details from uploaded pictures.
As I read on other posts, I have to re-run the query using the object_id in the POST object.
This only works for public images. Whenever I try to do this on a friend's photo, I get:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
One of them was a photo of my wife. I checked her privacy setting, as far as I can see, she doesn't block 3rd party API's.
How can I get photo details of posts that the API returns in me/home?
I know that it doesn't work for photo's with unique permissions (so e.g. with tags in them), but I tested it with photo's only shared with that person's friends. Tested about 10, none of them work. How is this possible?

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 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.