0

Can I get my facebook friends list using c# without any dialog box to confirm for permissions . I cannot use javascript sdk i need to use webapi in mvc to make a request for token then get friends list .

Code I am using to generate Access Token

  var fb = new FacebookClient();
            var result = fb.Get("oauth/access_token", new
            {
                client_id = "xxxxxxxx",
                client_secret = "xxxxxxxx",
                grant_type = "client_credentials"
            });
            var accessToken = Newtonsoft.Json.JsonConvert.DeserializeObject<AccessTokenModel>(result.ToString());

            string myAccessToken = accessToken.Access_Token.ToString();

Code I am using To get Friends List Just after code line in above code block

//I am getting at below line see error below //I am getting this error

   var friendListData = client.Get("/me?fields=friends"); 
   JObject friendListJson = JObject.Parse(friendListData.ToString());
Community
  • 1
  • 1
user3177519
  • 391
  • 2
  • 4
  • 12
  • No, you can not get that information without having the user login to your app and grant it permission first. (And even after that, you will only be able to see friends that are using the same app; there is no way to get “all friends” any more.) – CBroe Aug 23 '16 at 10:16
  • @CBroe Thanks for the info – user3177519 Aug 23 '16 at 10:44

0 Answers0