top of page
quetrawicribpest

Facebook API Get Friends Name: Using user_friends Permission and invitable_friends



It would not have been what you expected anyway, it was only for lists, not friends directly. Access to all friends is not possible since a very long time. You can only get data of users/friends who authorized your App. You can use the /me/friends endpoint for that.




facebook api get friends name




There is another way can give you an access to your all friend list names by downloading a copy of your facebook information data by selecting friends and following checkbox and wait till your file is ready then download it.


In addition, in v2.0, you must request the user_friends permission from each user. user_friends is no longer included by default in every login. Each user must grant the user_friends permission in order to appear in the response to /me/friends. See the Facebook upgrade guide for more detailed information, or review the summary below.


If you want to let your people tag their friends in stories that they publish to Facebook using your App, you can use the /me/taggable_friends API. Use of this endpoint requires review by Facebook and should only be used for the case where you're rendering a list of friends in order to let the user tag them in a post.


If your App is a Game AND your Game supports Facebook Canvas, you can use the /me/invitable_friends endpoint in order to render a custom invite dialog, then pass the tokens returned by this API to the standard Requests Dialog.


In other cases, apps are no longer able to retrieve the full list of a user's friends (only those friends who have specifically authorized your app using the user_friends permission). This has been confirmed by Facebook as 'by design'.


Option #1 from Simon Cross was not strong enough to invite friends to the app. Simon Cross also recommended the Requests Dialog, but that would only allow five requests at a time. The requests dialog also showed the same friends during any given Facebook logged in session. Not useful.


In the Facebook SDK Graph API v2.0 or above, you must request the user_friends permission from each user in the time of Facebook login since user_friends is no longer included by default in every login; we have to add that.


I've been wrestling with this all day myself and I believe I have figured it out, nowhere in facebook documentation (that I have found) is this clear. And I don't believe the other answers actually answered your question, it looks like you requested permissions correctly. Anyway, to request the information you are looking for, ping the api like this:


The query above will return the friends' ids with work history. You can add commas to the fields parameter to include additional info like name, but then the API calls/responses end up taking a long time.


Before that in your developer account created app-> go to tools and support->graph API explorer-> click Get Token. In that window click user_tagged_places and click Get Access Token. You will get your friends list.


Furthermore, whereas virtually all interactions except for private messages between users on Twitter are public statuses, Facebook allows for much more finely grained privacy controls in which friendships can be organized and maintained as lists with varying levels of visibility available to a friend on any particular activity. For example, you might choose to share a link or photo only with a particular list of friends as opposed to your entire social network.


An official Python SDK for the Graph API is a community fork of that repository previously maintained by Facebook and can be installed per the standard protocol with pip via pip install facebook-sdk. This package contains a few useful convenience methods that allow you to interact with Facebook in a number of ways, including the ability to make FQL queries and post statuses or photos. However, there are really just a few key methods from the GraphAPI class (defined in the facebook.py source file) that you need to know about in order to use the Graph API to fetch data as shown next, so you could just as easily opt to query over HTTP directly with requests (as was illustrated in Example 2-1) if you prefer. The methods are:


Reducing the scope of the expected data tends to speed up the response. If you have a lot of Facebook friends, the previous query may take some time to execute. Consider trying out the option to use field expansion and make a single query, or try limiting results with a list slice such as friends[:100] to limit the scope of analysis to 100 of your friends while you are initially exploring the data.


The number of Facebook objects available to the Graph API is enormous. Can you examine objects such as photos or checkins to discover insights about anyone in your network? For example, who posts the most pictures, and can you tell what are they about based on the comments stream? Where do your friends check in most often?


Use the Graph API to collect other kinds of data and find a suitable D3 visualization for rendering it. For example, can you plot where your friends live or where they grew up on a map? Which of your friends still live in their hometowns?


Try out some different similarity metrics to compute your most similar friendships. The Jaccard Index is a good starting point. See Analyzing Bigrams in Human Language for some information that may be helpful here.


The Graph API is named after the idea of a 'social graph' - a representation of the information on Facebook composed of nodes, edges and fields.In some cases node can have field and edge with the same name eg. like which as field stores number of likes and as edge links to array of likes. At the same time an event has attending_count field and attending edge.


The taggable_friends API retrieves a list of friends that can be tagged by the user in stories. Not all friends will be displayed, but of the ones that appear, the API will return the a encrypted ID that can be used for tagging, their name and profile photo. The use of this end-point requires login review from Facebook.


You can use the encrypted IDs from API call to then tag friends in stories (status updates or actions). You must include the place attribute as Facebook only allows friends to be tagged at location. However, if you use a page_id with no address, Facebook hide the location and create a normal status update.


If you make the API call to taggable_friends, it will return the IDs, Names and Profile Pictures of friends that can be tagged. You can then create a comma separate list of IDs and add them to $tags. See the examples here.


I just want to let the user upload a photo and then they can see the list of friends to choose to tag in the pic. And then my app would match that friend to their id and then submit that id into the tag parameter to achieve the tag. Does that work?


Hello Niraj,I am a non-tech person aso excuse for my simple question.So basically what this means is that if you develop an app that is not classified as a social game, users can not invite their facebook friends unless they already downloaded and signed up for that app?Thanks for your time!


1-UserA sent facebook invitation to UserB to install app . 2-We perform a query and store UserA id as sender id and user B id as recipient id, in our DB . 3-When User B click on Facebook notification it opens a canvas page with 2 buttons Accept or Reject 4-While accept we Detect user B id and update our Db and reward UserA with some coins


Yes, you will get the same request ID when inviting multiple friends. But remember, you are only interested in who sent the request. Once the user is authenticated, you can link it back to the Inviting user to award them coins.


That API calls is for tagging friends in a new post in group, right? Then how about tagging friends in a comment in a specific post in a group? One post per day in the group might be spammy, I think comments will be better. Can you help?


Hai Niraj, I tried to fetch facebook friendlist with access token with php and javascript as well, in both way returns empty data array, it just list the count of my friends. how to slove this issue?Would U plz help..


If the user names were stored in some database we need to query, all we need to do is return a Promise or use an async function. If any dependencies change, the selector will be re-evaluated and execute a new query. The results are cached, so the query will only execute once per unique input.


The following example will render the current user's name and a list of their friends. If a friend's name is clicked on, they will become the current user and the name and list will be automatically updated.


If you notice in the above example, the friendsInfoQuery uses a query to get the info for each friend. But, by doing this in a loop they are essentially serialized. If the lookup is fast, maybe that's ok. If it's expensive, you can use a concurrency helper such as waitForAll to run them in parallel. This helper accepts both arrays and named objects of dependencies.


To get the list of online friends in PHP, first you need to authenticate users with their Facebook account asking for the permission friends_online_presence. This is done using the Facebook PHP SDK (see on github) adding friends_online_presence to the scope while generating the login link:


Facebook is an online social media and social networking service owned by American company Meta Platforms. Founded in 2004 by Mark Zuckerberg with fellow Harvard College students and roommates Eduardo Saverin, Andrew McCollum, Dustin Moskovitz, and Chris Hughes, its name comes from the face book directories often given to American university students. Membership was initially limited to Harvard students, gradually expanding to other North American universities and, since 2006, anyone over 13 years old. As of July 2022, Facebook claimed 2.93 billion monthly active users,[6] and ranked third worldwide among the most visited websites as of July 2022.[7] It was the most downloaded mobile app of the 2010s.[8] 2ff7e9595c


1 view0 comments

Recent Posts

See All

Comments


bottom of page