public static async Task <XboxProfile> GetProfileAsync(string Gamertag) { string Endpoint = string.Format("/friends/search?gt={0}", Gamertag); Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false); return(new XboxProfile(Response)); }
public static async Task <XboxProfile> GetProfileAsync() { string Endpoint = "/account"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false); return(new XboxProfile(Response)); }
public static async Task <Friend> GetSummaryAsync() { string Endpoint = "/player/summary"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false); return(new Friend(Response)); }
public static async Task <Conversation> GetConversationAsync(string xuid) { string Endpoint = string.Format("/conversations/{0}", xuid); Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false); return(Conversation.DeserializeJSON(Response)); }
public static async Task <List <Friend> > GetFriendsAsync() { string Endpoint = "/friends"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false); List <Friend> Return = new List <Friend>(); List <JToken> tokens = new List <JToken>(JObject.Parse(Response).SelectTokens("people")); foreach (JToken t in tokens.Children()) { Return.Add(new Friend(Person.DeserializeJSON(t))); } return(Return); }
public static async Task <List <Alert> > GetAlertsAsync() { string Endpoint = "/alerts"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false); List <JToken> tokens = new List <JToken>(JObject.Parse(Response).SelectTokens("alerts")); List <Alert> l = new List <Alert>(); foreach (JToken t in tokens.Children()) { l.Add(Alert.DeserializeJSON(t)); } return(l); }
public static async Task RemoveFriendAsync(string xuid) { string Endpoint = string.Format("/friends/remove/{0}", xuid); Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = await RestServices.GetResponseAsync(RequestAddress, APIKEY).ConfigureAwait(false); }