I wand to get logged user's all friends and their user ids.I tried with graph api {friend_list_id}/members but I got
{
"data": [
]
}
I think this mean there are no any friends for this friend list id.Then I tried with me/friends but it doesn't provide all friends.Is there any solution for this.
Use This one me/friendlists but one condition is there.
The field 'friendlists' is only accessible on the User object after the user grants the 'read_custom_friendlists' permission.
Related
I am building a website using React and Redux to search facebook photos through tags like my Friends name or by location. User needs to login with facebook so that the application can read its pictures. A user simply puts in the search filters like Tagged users or the location of the picture and my app will show results based on the filters. This will help to find old photos with friends which sometimes get lost on social media due to a large number of photos present(Uploaded or Tagged)
I am trying to fetch mutual photos of me and my friends using my access token and trying to read the tags present in the photos through API but the Response contains only my name in the tags and not other people who are tagged in that photo.
Is there any way to fetch the users who are tagged on a photo uploaded? Any help is appreciated.
Graph api link
Access to any data involving your friends is only possible if those friends specifically authorized your App too. You cannot even get an ID of a friend if he did not authorize your App.
Yes, in order to access involving your friend to authorize your app. But from the details i can see that,
"A user access token may read a photo that the current user is tagged in if they have granted the user_photos or user_posts permission. However, in some cases the photo's owner's privacy settings may not allow your application to access it."
Note: Just need to verify users privacy setting once again.
I am using the FB graph api to get a list of my friends' friends using:
https://graph.facebook.com/<id>/friends?access_token=<token>
Now the weird thing is that this works for some of my friends and does not work for some others. Could somebody tell me why this is happening and a possible fix?
In cases where it does not work, I get the following message: "Can't lookup all friends of YYYYYY. Can only lookup for the logged in user (XXXXX), or friends of the logged in user with the appropriate permission"
And I repeat, I AM ABLE to get friend lists of some of my friends using the above URL. What permissions are being mentioned here?
In new SDK of the Graph API is not possible to do that.
Take a look here.
I do the call:
FB.api('/me/friends', function(response) { console.log(response);});
I see in the console log response as and object with empty data and correct summary:
Object { data=[0], summary={...}}
Where summary is (the number of my friends):
Object { total_count=444}
I know that friends edge call has been changed through APi v2.1. It works in Graph API explorer. I hve specified permissions for the requested operation before:
<fb:login-button scope="user_friends" onlogin="checkLoginState();">
</fb:login-button>
What am I doing wrong?
You misunderstand what the user_friends permission is for. This is taken from the docs about the user_friends permission:
user_friends
Provides access the list of friends that also use your app. These friends can be found on the friends edge on the user object.
In order for a person to show up in one person's friend list, both people must have decided to share their list of friends with your app
and not disabled that permission during login. Also both friends must have been asked for user_friends during the login process.
Review
Your app may use this permission without review from Facebook.
Common Usage
Use the list of friends to create a social experience in your app.
This question already has answers here:
Get a list of friends of a friend on Facebook
(6 answers)
Closed 9 years ago.
I was trying to understand permissions around friends list using graph api explorer.
If there is a user whose friends list is public and the user is not in my friends list nor do I have any mutual friends with that person - i can still see friends of that person on Facebook which tells me that their friends list is public. But when I use graph api explorer to do the same for that user I see the following exception:
{
"error": {
"message": "Unsupported operation",
"type": "FacebookApiException",
"code": 100
}
}
Does someone know why that is?
Also, another related question is - even if I can see my friend's friends on Facebook, I cant see that via graph api explorer because for graph api to show it my friends should have made their friends list public, is that correct?
Thanks.
The Graph API only allows you to see friends of the authenticated user. This is correct way as it's saying
I (the authenticated user) am granting you (the application) access to see my friends
So friends of friends, non-mutual and so on are not allowed.
If I have an access token for a Facebook user, is there a way to see which of their friends are going to an event? I'd like there to be a way to filter https://graph.facebook.com/<event_id>/attending/?access_token=<a_t> to only return friends of the user whose access_token is provided.
If you also include the friends_events permission with your token you can get the list of friends attending. I just verified in the Graph API Explorer that this permission and {event id}/attending will work like a charm.
Another way would be to use FQL, but it will be messier.