Question

I would like to build a management app in C# (probably ASP.NET C# using .NET 4). I would like to GET a list of my Facebook friends and then save there names, display pic, Date of friendship and there Facebook UserID AND/OR Username.

When you run the application for the first time, it should retrieve the details and then log a date time stamp against the record. Then when you run the application again it will make a check, if they exist in the database but NOT in Facebook then create a new record in another table called,deleted`. I will then query that table separately to display the deleted people. Ideally i need this application to run daily to get an idea of WHEN they deleted me.

I am pretty sure Facebook offers an API that i can use to GET my friends-list? Any examples on sample code for getting your own friends-list?

Was it helpful?

Solution

You can retrieve the names and ids for the users in your friend list by performing a GET request to /me/friends endpoint of the Graph API. In order to make this request, a user access token with user_friends permission is required. You can read more about access tokens here.

Once you have a valid Access Token, you can simply make a GET request using any of the Facebook SDK or simply by using the following URL:

https://graph.facebook.com/me/friends?access_token={Access_Token}

This will return the list of name and user id for the users in your friend list.

You can always use Graph API Explorer to test your request and FQL queries.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top