public ContactResponsAuthor getPerson(string AccessToken) { String Result = Utility.Web.WebRequest(Utility.Web.Method.GET, string.Format(ContactsUrl, AccessToken), string.Empty); ContactRespons Contacts = JsonConvert.DeserializeObject <ContactRespons>(Result.Replace("$", "_")); return(Contacts.feed.author[0]); }
//public ContactRespons getContacts(string UserHash) public List <Target> getContacts(string UserHash) { List <Target> output = new List <Target>(); String Result = Utility.Web.WebRequest(Utility.Web.Method.GET, string.Format(ContactsUrl, this.GetAccessTokenFromDatabase(UserHash)), string.Empty); ContactRespons Contacts = JsonConvert.DeserializeObject <ContactRespons>(Result.Replace("$", "_")); foreach (ContactResponsEntry item in Contacts.feed.entry) { string email = item.gd_email.FirstOrDefault().address; string name = item.title._t; if (string.IsNullOrEmpty(name)) { name = email; } if (!string.IsNullOrEmpty(email)) { output.Add(new Target { Identifier = email, Name = name, ProfilePicure = string.Empty, SourceType = 3, Network = "Google" }); } } return(output); }
public List <Target> getContacts(string UserHash) { List <Target> output = new List <Target>(); String Result = Utility.Web.WebRequest(Utility.Web.Method.GET, string.Format(ContactsUrl, this.GetAccessTokenFromDatabase(UserHash)), string.Empty); ContactRespons Contacts = JsonConvert.DeserializeObject <ContactRespons>(Result); foreach (ContactResponsUser item in Contacts.data) { if (!string.IsNullOrEmpty(item.emails.preferred)) { output.Add(new Target { Identifier = item.emails.preferred, Name = item.name, ProfilePicure = string.Empty, SourceType = 4, Network = "Hotmail" }); } } return(output); }