Facebook API v6.0 to find mutual friends - facebook-graph-api

With the most recent version (6.0) of the Facebook Graph API, there are no longer endpoints to find mutual friends between two users or get the friends list of a user.
If I want to find the number of mutual friends of two users on my app, how would I go about doing so? I can get the number of mutual friends who are also using the app (https://developers.facebook.com/docs/graph-api/reference/user/friends/), but what if I want to get the total number of mutual friends?

You can’t do that any more.
https://developers.facebook.com/docs/graph-api/changelog/version3.1#mutual-friends-api:
Mutual Friends API
These changes apply to v3.1+, and will apply to all versions on October 24, 2018.
The Mutual Friends API was deprecated on April 4, 2018, and the endpoints below started returning empty data sets. The endpoints are now fully deprecated and will return an error.
/user-context/all_mutual_friends
/user-context/mutual_friends
/user-context/three_degree_mutual_friends
This has been removed for good, and there is no current replacement.

Related

Fetch comment from specific user on a page post?

With FQL being deprecated, is there an alternative graph-y way of fetching the post-comments from a specific user without resorting to downloading all comments first and enumerating them?
Before I could just trigger an FQL statement like
SELECT text FROM comment
WHERE post_id = '<postid>' AND fromid = '<uid>'
But since that is no longer supported without using the older API, I'm wondering if there's an alternative for v2.1 and up?
Why? I organise a fair amount of give-away-contests on Facebook and have a script that retrieves the amount of likes from the announcement post, picks a number of random ones and then retrieves the comments of those users on that same post.
As a side remark: I hate it that I as a page owner cannot retrieve a list of people that liked my own page via the API. I still have to check that manually each time.
Unfortunately there's no way to filter the comments by user directly with the current Graph API version.
If you're using a v2.0 app, you can still use FQL until August 7th 2016. I'd wait and see if FB amends the Graph API with similar functionality as FQL had in the future.

Facebook Graph API /me/home Friends Posts

I'm trying to get the home feed for a user, but all the posts by my friends are no longer there (only feeds by Pages show). This happened near the v2.2 release. Are we no longer able to get a user's news feed with their friends posts? https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=me%2Fhome&version=v2.0
friend permissions are gone with v2.0 - so i assume this happened in April 2014 when v2.0 was introduced, for privacy reasons you can´t get anything from friends who did not authorize your app too. Wouldn´t it be weird if you could just see the posts of friends in the stream of the authorized user, without the friends being able to control this?
Check out the changelog for more information: https://developers.facebook.com/docs/apps/changelog
It looks like friends' news are back on the /me/home end point

getting list of friends from facebook

Facebook API does not provide friends list of people using our fb app, according to their developer faq page. But still, websites like nimble and the live example of socialauth are able to get the names of people on our friend list, even those who do not use their app. Please, can any one help me with how this work?
The read_friendlist permission gives only name of lists like 'close friends', 'aquaintance' etc. the user_friends permission gives only the list of people in our friendlist who use our app.
What all api permssions do we need to get the full friend list?
I am trying to make an address book by importing contacts from google, facebook etc. using socialauth. Had success with google.
Those websites are probably using older Apps with v1.0 - it will stop working for them after end of April 2015. You can only use v1.0 with an App created before end of April 2014.
All 'friends_*' permissions have been removed from new version 2.1
You can use 'user_friends'
https://developers.facebook.com/docs/apps/upgrading
https://developers.facebook.com/docs/apps/changelog
For fetching app users user 'me/friends'
For more friends use 'me/taggable_friends' .
Remember it will still not return whole friends.
In new facebook api version there is no way to fetch whole friend list at one time

Corona SDK Facebook returns app_scoped_id and not my normal user_id

If I have understood it correctly Facebook made some changes so it returns app_scoped_id instead of the normal user_id.
The problem I have now is that no other function seems to work.
I receive an I id from Facebook, and it's the same each time I login, but if I use facebook.request("me/friends") the table is empty, if I use facebook.showDialog("friends") it
What do I need to do in Corona SDK to get this to work? Before I could use these functions after having setup them up in Facebook.
I read this thread explaining why this happen but it doesn't explain how to solve it in Corona SDK: Get Users App-Scoped user id in Facebook Graph API
As of Facebook API v2.0, friends list (/me/friend) returns ONLY user's friends who are already using your application. This limitation applies to all apps that are on v1.0 mode too.
If you're looking to get friends for tagging actions: https://developers.facebook.com/docs/graph-api/reference/v2.0/user/taggable_friends
If you're looking to get friends for inviting to a Facebook Game on Canvas: https://developers.facebook.com/docs/graph-api/reference/v2.0/user/invitable_friends
Cheers!

Some friends on the Facebook website do not appear in the Graph API

I was playing with the Graph API recently and I made the following simple call:
https://graph.facebook.com/me/friends
For me, this returns 461 entries. On my profile page on the Facebook website, I have 465 friends. On the following page, I have 477 friends:
https://www.facebook.com/me/friends
I've discovered that 12 of my friends has deactivated their profiles, which would account for the difference between the 477 and the 465. However, that still does not explain the difference between the Graph API call and the number that appears on my profile.
This leads me to my questions:
Is there a way to retrieve a list of inactive friends via Facebook API?
What other reasons are there aside from user inactivity that a friend connection would not appear on the Graph API? Is there a user's privacy setting for such control?
Thanks!
This is absolutely normal behavior. There is an option in Facebook that let's you disable all apps. Reference: Facebook: Disable all apps If they have that turned on, your app to not be able to reach them.
As of finding inactive friends, the answer is NO, you can't not. They are not a part of the Facebook public platform and therefore you don't have access to them.