Today I started get some strange FQL Error.
FQL query: *SELECT target_id FROM connection WHERE source_id = user_id1 AND target_id = user_id2*
*SELECT uid FROM user WHERE has_added_app=1 and uid IN (SELECT uid2 FROM friend WHERE uid1 = "user_id")*
FQL Response (Error): Error: Requires extended permission: read_stream
What is it???
Help.
According to their Change Log, on 2011-09-18, Facebook pushed this update:
FQL connection table now requires read_stream permission. (rE435878)
I had the same problem. I was only using the connection table to get a list of friends, so I was able to change to the friend table to pull the info I needed.
Stuff like this is what makes Facebook Platform a hostile development environment.
Looks like facebook has changed some of the required permissions for some actions this night. The same happened to me. You need to ask for read_stream permissions. For more information refer here
P.S: You might need to remove the application from your profile and add it again with the new permissions
Related
So, after looking around the two solutions ive seen are:
1) Using the graph API
me/friends?fields=installed
2) Using FQL
SELECT uid FROM user WHERE uid in (SELECT uid1 FROM friend WHERE uid2=me()) AND is_app_user
SELECT uid FROM user WHERE uid in (SELECT uid1 FROM friend WHERE uid2=me()) AND NOT is_app_user
Using the graph API i'm always met with permissions issues and cannot find what permission i need to request in order to access it. And the FQL solution seems to always return false.
So I'm left wondering if theres something simple that im missing in order to get this working,or whether or not these methods are outdated and theres a better way.
Thanks in advance
EDIT 1
I should mention that i am working from a C# api
Using PHP SDK you can get the friendlist by using:
$facebook->api(array('method' => 'friends.getAppUsers'));
As for the permissions: You need to have the email permission to get the friends list with installed flag in it.
I can guess that you are following the normal login flow. like,
1)opening session
2)requesting read permissions (user_info etc.)
just add the "email" permission in read permissions as well and you shall get this installed flag.
3) and then you can use either the graph api or FQL, results should be similar.
When I access the list of my friends using the URL https://graph.facebook.com/me/friends?access_token=... I can see the list of my friends. I can do this programmatically as well.
Now, when I take the ID of any of my friends and replace it with "me" in the above URL, and paste the URL in the browser, I can see my friend's friends. I am unable to do this programmatically because it is giving me an HTTP 400 ERROR.
Does anyone know why this is possible by pasting the URL and not programmatically?
You can not get the "friends of friends" using the facebook api.
For example, try the simple /me/friends with the Graph API Explorer, it should work fine.
Then, take one of the ids there and try the same with FRIEND_ID/friends and you should get this:
{
"error": {
"message": "(#604) Can't lookup all friends of FRIEN_ID. Can only lookup for the logged in user or the logged in user's friends that are users of your app.",
"type": "OAuthException",
"code": 604
}
}
The error itself is very straight forward and explains exactly what the problem is.
As for why that translates into a 400 error code for you is unclear.
Edit
You can't see the "friends of friends" in the browser as well, the reason that it works for you (probably) is that the user(s) you check the friends for (USER_ID/friends) installed the app that the access token belongs to, from the way you got to that url I assume that the app is the "Test_console".
How to check? Copy the access token from the url (USER_ID/friends?access_token=xxxxx), go to the Facebook Debugger and paste the token in the text field and click "Debug", it will show you info regarding the application.
The user you checked it for probably has that app "installed", if you check it for other users you will get that error when you get to a user who does not have that app "installed".
I hope this clarifies it for you.
I got friends of friends(limited) who are using application. I had same problem. Though it is very late for answering question, it will help somebody. That's why answering this question.
We can get friends of friends those are app users.
$fb_id= user id whose friends of friends required.
Try this fql query.
$query="SELECT uid, name, work_history FROM user WHERE uid IN (SELECT
uid2 FROM friend WHERE uid1 IN (SELECT uid FROM user WHERE uid IN
(SELECT uid2 FROM friend WHERE uid1 = $fb_id ) and is_app_user=1) )";
It needs following requirements:
Your friend needs to be using application.
Permission from application read_stream, publish_stream, publish_checkins.
could somebody help me with Facebook API, how to get relationship status of friends(single, married, etc...)?
Thanks for any help.
You just need to get an access token with user_relationships, call https://graph.facebook.com/YOURFRIEND-ID and check "relationship_status" in the returned JSON string.
Just have in mind that if your friend didn't filled his relationship data into his profile, there will be no "relationship_status" at the returned user info.
Try this FQL in the Graph explorer tool
fql?q=SELECT uid, name, relationship_status FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me())
You will no longer be allowed to get friends information in v2.0.
In my application I'm trying out to list only the friends who are all single.
I tried different methods and it didn't return proper values...
I tried the graph API but could list only all the friends irrespective of their relationship status.
i tried $facebook->api("/$user/friends?relationship_status='single'");
Also i tried to use FQL and fetch things up but the relationship status always return up as 'null' for even the user who have approved the applications and gave permission to access their relationship_status..
the fql query i tried is
SELECT
uid,name, relationship_status, current_location
FROM user
WHERE
uid IN (SELECT uid2 FROM friend WHERE uid1 = 2343434434234)
How can i get this done?
The problem is that you're only asking for that user's relationship status. You need to also ask for the friends_relationships permission. Once you do that, your query will work fine.
I've been looking at this at every possible angle and I can't make my mind around it, maybe you guys can help. I run this query to get my friend's hometown and location:
SELECT uid, name, timezone, hometown_location, current_location
FROM user WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = me() )
And hometown_location and current_location are always NULL, even when they shouldn't be. Using something like /me/friends?fields=hometown,location,... has the same result.
Also, querying for my own hometown_location and current_location DOES WORK. Which makes me think I don't have the permissions to access my friends' hometown & location.. but shouldn't then an error be raised, if this was the case?
Still, my app has the same permissions: user_about_me, friends_about_me, user_hometown, friends_hometown, user_location & friends_location, so I don't think this is the issue.
If I go to http://developers.facebook.com/docs/reference/api/ and click on the https://graph.facebook.com/me/friends?access_token=... link, and I append &fields=name,hometown, it works, so I know it can be done.
Any idea what could I be doing wrong?
Thanks a lot!
Manuel
For friends_hometown you need friends_hometown permission.
For current_location you need friends_location permission.
Once you ensure you have those permissions you should be able to get the data by running that query or through the Graph API - https://graph.facebook.com/FRIEND_ID?fields=hometown,location with an access_token having those permissions.
Are you using Simon Cross' interface?
https://www.simoncross.com/fb/graph/
It can help you understand what is the problem. Try to regenerate your access_token you might still use an old token which didn't have extended permissions for friend_hometown.
The API doesn't throw any kind of error in case you (or the token used) don't have permission to access the data