Facebook Graph API, Unable to get user profile - facebook

When I http using graph API explorer in the context of "Graph API Explorer", I am able to query user information as -
/v2.0/{user-id}
when I http in the context of my app, I see the response as:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
Permission lists are same both on Graph API Explorer as well as my App:
user_about_me
user_activities
user_birthday
user_events
user_friends
user_likes
user_location
user_photos
user_status
user_videos
email
publish_actions
read_friendlists
read_stream

I regenerated a new access token and tried different sets of user ids and it seems to be working now.

Related

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/

Getting feeds from Facebook groups using Graph API HTTP requests

I would like to integrate my APP with some existing groups in Facebook.
So, for that, I would like to be able to read people's posts.
I have tried the following HTTP request to Facebook's graph API:
http://graph.facebook.com/v2.5/192992880732335
But it responds with the following:
{
"error": {
"message": "An access token is required to request this resource.",
"type": "OAuthException",
"code": 104,
"fbtrace_id": "By+n1YSvvrI"
}
}
How can I get an access token to a specific group?
It is pretty ease to get all the feeds from that group.
Just add the access token from some user and your are done:
https://graph.facebook.com/v2.5/192992880732335/feed?access_token=<ACCESS TOKEN>
To get the access token, it is just a matter of calling
FB.getAuthResponse().accessToken
after user's login.

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!

Accessing an application page with facebook graph api

I'm trying to access a facebook page's conversations using the graph api.
Accessing the page itself (with /{page_id}) is fine, but I get on oauth exception for the conversations.
My request in the graph explorer is this one :
/{page_id}/conversations where {page_id} is, well, the page id :)
and the error is
{
"error": {
"message": "(#10) Application does not have permission for this action",
"type": "OAuthException",
"code": 10
}
}
According to the documentation, the required authorization is read_page_mailboxes, which I granted. Here are the rights of my token as shown in the oauth debugger :
public_profile, basic_info, read_page_mailboxes, manage_pages, user_friends
Are there other permissions I'm supposed to require ?
In fact, just asking for the permission itself is not the right way to access to this page informations.
You have to recover the page access token located at /{page_id}?fields=access_token and use this token in order to access the conversations.