I'm looking for informations about this fanpage : https://www.facebook.com/gabrielmedinasurf
when I call the graph API (v1.0) at https://graph.facebook.com/gabrielmedinasurf
I get nothing but a RTFM message :
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
This process was supported a month ago. Does anyone had to face the same problem ?
I know the page ID : 206550296052269
but calling the API with it gave me the same result (https://graph.facebook.com/206550296052269)
Note : The v1.0 should be available until April 30, 2015 (source : https://developers.facebook.com/docs/apps/changelog)
Any help is welcome
NOTE : On this older post from SO, the process seems to work : Get Facebook fan page ID
Always use an Access Token for any Graph API call. That being said, the Page may be restricted by age or location, an App Access Token is not good enough in that case. You can only use a User Access Token or Page Access Token. I just tried with a User Token and it worked for that Page.
If you don´t know how to handle the different Access Tokens, take a look at the following links:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
Related
I have a web application that uses Facebook API. Now, I'm facing with an issue on getting the total of likes from a user's post.
I have a long lived "userToken" valid for 2 months with the following scopes: public_profile, email, manage_pages, publish_actions
I use "POST /feed" to send a link into the user's timeline and I get a post ID.
Then, I try to get the total of likes for this post with "GET /{POST_ID}/likes?sumary=true" and I get ZERO likes even if the post has many likes.
{
"data": [
],
"summary": {
"total_count": 0
}
}
I tried to use only "GET /{POST_ID}" to get post information and I get the following json response:
{
"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 this issue only when I post to a user's timeline. However, when I post to a Facebook page, I can get the post ID and the numer of likes.
I made a test by adding read_stream scope and I can get the post information. However I read in API documentation that this permission has a limited use: "This permission is granted to apps building a Facebook-branded client on platforms where Facebook is not already available"
Then, I started to check other applications that get post likes and I noticed that they are using only public_profile, email, manage_pages, publish_actions. They are not using read_stream.
So, my question is how they can get this information only with these scopes?
I hope anyone of you will be able to help me?
Thanks
Can you please check, if the post is public.
If you have the post id of a public post you can fetch the likes simply by requesting the endpoint you already mentioned.
To get your feed you need the read_stream or user_posts permission.
searched around on a way to unlike facebook fan page but no success
the only way i figure out is :
https://graph.facebook.com/me/likes?method=delete&url=http://www.facebook.com/FNAPAGE&access_token=
error :
{
"error": {
"message": "(#200) App does not have permission to make this call",
"type": "OAuthException",
"code": 200
}
}
so is there a way to unlike facebook fan page ? whatever if its through php or java api .
In the User object documentation, under the Likes connection there's nothing about changing/deleting or even adding likes, it just has a way of reading the user likes.
So as it looks, currently you have no way of automating this, and you'll have to manually go to each page you want to remove the like.
Facebook API v2, released April 30th, 2014, includes an end point for deleting a like.
https://developers.facebook.com/docs/graph-api/reference/v2.5/object/likes#delete
I am having some unusual errors while fetching some data for some users via graph API.
As for example w all know we can get basic user info via graph.facebook.com/username
And it works. But it is not working for some users. Like the user www.facebook.com/sanzida.tanzum is a valid facebook user. So, we should get her basic info via graph.facebook.com/sanzida.tanzum. But when you will try that, you will get the error
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
And it is not a permission issue because use user herself gets the same error when she try to retrive her own data via graph API. Actually the user sanzida.tanzum is invisible to graph API. For example user sanzida.tanzum is on my friend list. You can check here. my friendlist.(it is public). But when I retrive my friendlist via graph API, my friendlist is shown excluding the user sanzida.tanzum ! But she is in my friendlist!
I have tried to contact facebook for this matter because I did not find any doccument related to this matter. They replied it is usual. (probably they did not read my mail at all. I am including the email conversation with facebook)
Hi তৌফিক,
They are getting errors because they are not you... they dont have
permissions to see the same things you do. They might also be missing
an access token. Either way: no bug here.
Thanks,
Emrakul Security Facebook
-----Original Message----- From: *****#ovi.com To: Subject: Report a Security Vulnerability - Unusual bug in facebook graph API
Your Email Address: *****#ovi.com Do you have technical details of
a security vulnerability?: Yes Vulnerability Type: Privacy /
Authentication Vulnerability Scope: Platform Developer API Title:
Unusual bug in facebook graph API Product / URL:
https://graph.facebook.com/sanzida.tanzum Description and Impact: I
was doing some graph API calls for testing purpose. Mostly I was doing
mostly user profile calls. (https://graph.facebook.com/exampleuser)
Somehow I realized facebook is giving following errors for some users
even they are on my friendlist. Same thing occurs when they try by
themselves.
As for eample the user "https://www.facebook.com/sanzida.tanzum" is on
my friendlist. (My friendlist is public.You can check if you want.)
So, according to facebook graph API, I can request the user's basic
info using (https://graph.facebook.com/sanzida.tanzum) But it returns
this error:
"{ "error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100 } }"
Actually graph API can't access nothing of this user. Another
example.. When I request my friendlist via graph API , All friends of
my friendlist is shown except the user (sanzida.tanzum). But she is in
my friendlist! check here (my friendlist is public)
"https://www.facebook.com/toufiqueimam/friends". So why is this
happening only for few users?
Just now I got confirmation that the user herself gets the same error
if she tries to access (https://graph.facebook.com/sanzida.tanzum)
{ "error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100 } }
Reproduction Instructions / Proof of Concept: Reproduction: first go
to https://www.facebook.com/sanzida.tanzum You will see it is a valid
profile. Now try https://graph.facebook.com/sanzida.tanzum You will
get following error
{ "error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100 } }
This isn't a bug, the error means that the data you're trying to access is not accessible to you, does not exist, has been deleted, is not available because you haven't provided an access token from a user who can see it, etc.
See this answer for an example of this error message in relation to Facebook pages: https://stackoverflow.com/a/6847088/21062 - the same is true when trying to access user profiles if that user has blocked you, blocked your app, disabled their account or disabled all apps from accessing their information.
Just an FYI, I ran into this problem, and it wasn't because the user had blocked all applications. In my scenario, my application was attempting to force-convert Facebook's 64 bit integers into a 53 bit JavaScript integer (Node application). It was mangling the value, so when I was making the Facebook GET Request later on in my application lifecycle, I was doing so with the mangled value, and Facebook was trying to tell me "Um, this UserId doesn't exist".
So in my application, I had to use the Node Big-integer add-on, along with the Mongoose mongoose-long plugin for my Mongodb.
Long story short, if you are converting the UserId to it's native 64 bit integer, don't do so unless the intger type in your application is at least 64 bits.
Facebook has some great-looking examples of Open Graph requests here:
https://developers.facebook.com/docs/reference/api/examples/
The problem is that since I don't have an access token, most of the examples just return
{
"error": {
"message": "An active access token must be used to query information about the current user.",
"type": "OAuthException",
"code": 2500
}
}
I understand access tokens, but how do I get the token so that I can experiment with these example requests?
As long as you only want to test...
Use the Graph API Explorer to generate a token with the permissions you want.
Don't hesitate to select all of them.
Then, just copy/paste the token at the end of each graph.facebook.com URL. For instance:
https://graph.facebook.com/v1.0/me/friends?access_token=<ACCESS_TOKEN>
The day you want to get the access taken for an app...
Start by reading this doc.
I created and APP on the Facebook.
Now I am trying to post a comment on the user's timeline using the Graph API but I cannot undestand what I need to do.
I already authorized the Application (I authorized this permissions: 'user_status,publish_stream,user_photos,email').
If I look on my profile -> privacy I can see that the APP can:
This app can: Post on your behalf
This app may post on your behalf, including status updates, photos and more.
Last data access:
Basic InformationToday
See details · Learn more
Posts on your behalf:
Who can see posts this app makes for you on your Facebook timeline?
Public
Notifications:
When to notify you?
The app sends you a notification
So this part seems OK.
On my application I do the following to try to post somenthing on my timeline (I need to post it when I am off line).
1) GET : https://graph.facebook.com/oauth/access_token?client_id=APPID&client_secret=*APP_SECRET*&grant_type=client_credentials
RESPONSE:
access_token = 422828347771671|UdQELQIf0N7krF4JUo7VwtPLTkk
2) GET: https://graph.facebook.com/search?q=myemail&type=user
RESPONSE:
_"error":_{
______"message":_"A_user_access_token_is_required_to_request_this_resource_",
______"type":_"OAuthException",
______"code":_102
___}
But reading the documentation (https://developers.facebook.com/docs/reference/api/#searching) it seems that this request does not need any kind of access token.
I also tried to add the access token, but the result is still the same.
3) I know my facebookid so I tried to use it directly:
POST: https://graph.facebook.com/100001139132403/feed
ARGUMENT:
access_token=422828347771671|UdQELQIf0N7krF4JUo7VwtPLTkk,
message=Hello
RESPONSE:
"error": {
"message": "(#200) This API call requires a valid app_id.",
"type": "OAuthException",
"code": 200
}
}
So I tried to add client_id=APPID and app_id=APPID, I tried to put one, the other and also both arguments as GET or POST but nothing changed.
I checked the APPId ad it is correct.
Do someone have any idea?
Thank you!
You cant simply generate a user access_token by querying to a URL. What you did gives the App access token and as the error say, you are trying to do something, that needs user access_token.
Refer and implement this : https://developers.facebook.com/docs/howtos/login/server-side-login/
And use that access_token for the rest of the processes.