Facebook Graph API - Retrieve photo - Unsupported get request - facebook

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?

Related

Facebook Instagram Graph Api Get Tags with username

I tried the Instagram-Graph-Api because the current Instagram-API will be shut down soon.
I want to retrieve posts, created with a specific Hashtag and read the Username who created that post.
Unfortunately the username-Field is not supported in the IG Hashtag API
You cannot request the username field on returned media objects.
OK, that's maybe a Facebook-Limitation. So I tried to fetch the Details of an object with the IG Media API. This Api works for Media-Objects what I created with my linked Facebook-Account for the Access-Token, but it does not works with other, public accounts.
Facebook wrote:
Fields marked with an asterisk (*) are public fields, which means they can be returned by an edge using field expansion.
And the username-Field in the documentation is wrapped with an *. So I think it's a public information to what we should have access to?
I do not found any limitation on facebook saying that the IG Media Api only allows to retrieve Elements from Pages where my Access-Token is authorized to, is this currently a limitation because my Facebook-App was not reviewed by Facebook?
This is the Graph-API-Call what I made:
GET https://graph.facebook.com/v7.0/18142822621010864?user_id=17841402377690736&fields=id%2Cusername&access_token=
And this is the response what I get:
{
"error": {
"message": "Unsupported get request. Object with ID '18142822621010864' 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,
"error_subcode": 33,
"fbtrace_id": "AMi0N96iFZ65hgvS1D1upsO"
}
}
Thank you
Matthias
Ok did a lot of research on this one last night. And simply put, Facebook locked down their api pretty hard.
You are not able to see any specific of a media item not owned by yourself.
You are not able to see any comments when your are not tagged or mentioned in the post
You are not able to get the username of media found via hashtags for example.
You should be able to see replies on your comments added to public media you do not own.

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"
}
}

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.

FB Graph API return unsuported get request even public post without restriction

I try to retrieve post's information from Graph API:
https://graph.facebook.com/100006679472813_1392957120936924?access_token={my_access_token}
The Facebook Graph response:
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
However, I can access the post by this link (same user as {my_access_token}) https://www.facebook.com/100006679472813_1392957120936924
And I can receive the original message of this post via Graph Search API too.
Not all posts return error. But so many do. How can I get it's detail via Graph API?
You can not read all the posts in the facebook. If you try to fetch the details of the post by the user other than the user in the session, you may or may not get the details of the post. This depends on the privacy settings of the user. So, only the public posts can be fetched (in case of other users)