Facebook-Graph-API get post by post id - facebook

I'm having problem fetching post by post id using Graph API.
In Graph API reference (https://developers.facebook.com/docs/reference/api/post/) it says that:
Querying without the read_stream permission will return only the public view of the data (i.e. data that can be see when the user is logged out).
I'm able to open https://www.facebook.com/franzee/posts/10151947780174121 without logging in to Facebook, but when I try to access this post using Graph API or Graph API Explorer I get the following error
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
I am using valid token and Graph API call, and I'm getting results when fetching single posts from group or public page. Why is then error message returned when I try to fetch post by post id even though the post is visible when I'm logged out?

You can't access a user's posts without a user access token from a user who can see the posts - even if a post is marked as 'Public', that means Public to Facebook users, not completely public via the web and API - You still need to provide the access token of the Facebook user you're fetching the posts on behalf of

Related

Facebook Graph API Business page missing permissions

I have created a facebook business page and i want to get some posts over the graph api.
I have set everything up (Developer App, Token...).
I get this error when I make an http request:
{
"error": {
"message": "Unsupported get request. Object with ID '492303394120348' 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": "DxgFcxGEl2Y"
}
}
When i am using the page-id of another facebook page it is working.
What is the problem here. Can someone please help me?
App Tokens are not a good way to access a Page with the API. If the Page is restricted by age or location, you need a User Token of a user who is able to see the Page, or a Page Token of that Page. You should always consider using a Page Token.

Facebook Business page - Unsupported get request

I have admin access to a Business Facebook page, I created an app under the same account, when I then try to use the Graph API Explorer under that application using the access token generated I get:
get/v2.5/{client-name}/
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
I have full access so I do not know why I am getting a error. This normally works fine when I try it on a standard Facebook page, is there something extra I need to do for Business pages?
Since you are trying with an App Token, i assume that the Page is restricted by age or location. In that case, you have to use a User Token or Page Token of a user who is allowed to see the Page and its content.
More information about Tokens:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/

Why does Facebook Graph API return error on some photos?

I am attempting to access Facebook API data on photos I am tagged in, (uploaded by other users). I am using this URL format:
https://graph.facebook.com/[photo-id]?access_token=[access-token]
The access tokens I am using are definitely valid, having logged in with my account and having granted user_photos permission. Some photos this works fine, and it returns the API data. However for other photos it returns the following error:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
I can't work out why some photos return this error. Some of the photos producing this error are public and some aren't. As I understood it, I should be able to access all photos I am tagged in through the API once I have granted the user_photos permission.
Update: The same applies when using the Graph API Explorer tool. I use the Get Access Token button to generate an access token with user_photos permissions. I get the same error message, even on photos shared with public, e.g. this photo id 10152429955981023
Update: The same photos also seem to be missing when I query /me/photos.

Get post likes without read_stream permission

I'm trying to achieve the following:
User logs in on my website using a custom Facebook Login
User creates a post on his wall using the feed dialog from my website
I store the post_id in a database
I need to query the post in order to get the number of likes it got with FB API
The problem is that Facebook new application review won't authorize my application to use the read_stream permission since it's in a website (as their policy says)
It seems (as on documentation) that I can retrieve a single post (published as "public") with just a valid user access token; but the Open Graph Explorer tool responds with this:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
Is there a way I can query a single public post with just a valid access token and without read_stream permission?
Or is there a way I can use the read_stream permission on a website?
Thank you in advance for your help!

Are non-app users' pictures still avalible in Facebook Open Graph v2.0?

In Graph API v1.0, I could get the profile picture of any user with the following call graph.facebook.com/{uid}/picture (fb doc).
In Graph API v2.0 facebook says it will return (a) app-scoped user ids for app users, and (b) temporary tokens for non-app users (through /me/taggable_friends and /me/invitable_friends api calls). Based on this, I would assume that the picture api call is deprecated in v2.0. However, the documentation makes it seem like there was not change to this call in v2.0.
Anybody knows if (full-size) public profile pictures of non-app users will be available in v2.0?
It is still possible to get a person's profile picture in v2.0.
http://graph.facebook.com/v2.0/APP_SCOPED_ID/picture will redirect to a picture of the user represented by that app-scoped ID.
If a user previously logged into your app when your app was coded against v1.0, they may still be known to your app by their original Facebook user ID. For this reason, http://graph.facebook.com/v2.0/ORIGINAL_USER_ID/picture will also still work.
/<user id>/picture does not require an access token in V2.0 and will work even when <user id> is an app scoped ID
The ID provided needs to be the user's actual ID or an app scoped IDthe response from /<user id>/invitable_friends or /<user_id>/taggable_friends won't work in the same way
Both of those APIs will also return you the full URL of the invitable or taggable user's photo
as part of the response, though.
It does work fine with original user IDs. For app-scoped IDs I haven't figured out how to use them.
While http://graph.facebook.com/v2.0/APP_SCOPED_ID/picture is supposed to work with the new app-scoped IDs, I can only get this response:
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
Note that this response is different from the response for completely invalid IDs. If you use an invalid user ID, you would get:
{
"error": {
"message": "(#100) No node specified",
"type": "OAuthException",
"code": 100
}
}
EDIT: As of May 10, 2014 this is a known bug.
The Graph API request that is currently working is
http://graph.facebook.com/v2.0/APP_SCOPED_ID?fields=picture