dotnet-practitioner
dotnet-practitioner

Reputation: 14148

vs2008 c#: Facebook.rest.api how to use it to get friends list?

How to make further progress from here? What would be next step to get friends list?

       string APIKey = ConfigurationManager.AppSettings["API_Key"];
        string APISecret = ConfigurationManager.AppSettings["API_Secret"];

        Facebook.Session.ConnectSession connectsession = new Facebook.Session.ConnectSession(APIKey, APISecret);
        Facebook.Rest.Api api = new Facebook.Rest.Api(connectsession);

Upvotes: 2

Views: 2353

Answers (2)

gradbot
gradbot

Reputation: 13862

You're really close. All that is left to do is call the GetLists method in the Friends namespace.

var friends = api.Friends.GetLists();
foreach (var friend in friends)
{
    System.Console.WriteLine(friend.name);
}

Here's the link to the REST api docs. It should help you find other functions. Another way is to just use visual studios IntelliSense. Type api. and visual studios should give you a list you can navigate through.

Upvotes: 6

Joshua Cauble
Joshua Cauble

Reputation: 1349

You might want to take a look at the application: Fishbowl It is a WPF Reference app for Facebook that has full source code. It may help you with many facebook items.

Upvotes: 1

Related Questions