public static async Task UnfavoriteFriendAsync(string xuid) { string Endpoint = "/friends/favorite/remove"; //string Data = string.Format("{\"xuids\":[{0}]}", xuid); string Data = "{\"xuids\":[" + xuid + "]}"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = await RestServices.GetPostResponseAsync(RequestAddress, Data, APIKEY).ConfigureAwait(false); }
public static void UnfavoriteFriend(string xuid) { string Endpoint = "/friends/favorite/remove"; //string Data = string.Format("{\"xuids\":[{0}]}", xuid); string Data = "{\"xuids\":[" + xuid + "]}"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = RestServices.GetPostResponse(RequestAddress, Data, APIKEY); }
public static XboxProfile GetProfile(string Gamertag) { string Endpoint = string.Format("/friends/search?gt={0}", Gamertag); Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = RestServices.GetResponse(RequestAddress, APIKEY); return(new XboxProfile(Response)); }
public static async Task SendMessageAsync(string Gamertag, string Message) { string Endpoint = "/conversations"; //string Data = string.Format("{\"to\":\"{0}\",\"message\":\"{1}\"}", Gamertag, Message); string Data = "{\"to\":\"" + Gamertag + "\",\"message\":\"" + Message + "\"}"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = await RestServices.GetPostResponseAsync(RequestAddress, Data, APIKEY).ConfigureAwait(false); }
public static string GetAchievements() { string Endpoint = "/achievements"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = RestServices.GetResponse(RequestAddress, APIKEY); return(Response); }
public static Friend GetSummary() { string Endpoint = "/player/summary"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = RestServices.GetResponse(RequestAddress, APIKEY); return(new Friend(Response)); }
public static string GetClips() { string Endpoint = "/dvr/gameclips"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = RestServices.GetResponse(RequestAddress, APIKEY); return(Response); }
public static string GetHistory() { string Endpoint = "/activity/history"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = RestServices.GetResponse(RequestAddress, APIKEY); return(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 <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 XboxProfile GetProfile() { string Endpoint = "/account"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = RestServices.GetResponse(RequestAddress, APIKEY); return(new XboxProfile(Response)); }
public static void SendMessage(string Gamertag, string Message) { string Endpoint = "/conversations"; //string Data = string.Format("{\"to\":\"{0}\",\"message\":\"{1}\"}", Gamertag, Message); string Data = "{\"to\":\"" + Gamertag + "\",\"message\":\"" + Message + "\"}"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = RestServices.GetPostResponse(RequestAddress, Data, APIKEY); }
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 Conversation GetConversation(string xuid) { string Endpoint = string.Format("/conversations/{0}", xuid); Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = RestServices.GetResponse(RequestAddress, APIKEY); return(Conversation.DeserializeJSON(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 IEnumerable <Friend> GetFriends() { string Endpoint = "/friends"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = RestServices.GetResponse(RequestAddress, APIKEY); List <JToken> tokens = new List <JToken>(JObject.Parse(Response).SelectTokens("people")); foreach (JToken t in tokens.Children()) { yield return(new Friend(Person.DeserializeJSON(t))); } }
public static IEnumerable <ConversationSummary> GetConversations() { string Endpoint = "/conversations"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = RestServices.GetResponse(RequestAddress, APIKEY); List <JToken> tokens = new List <JToken>(JObject.Parse(Response).SelectTokens("results")); foreach (JToken t in tokens.Children()) { yield return(ConversationSummary.DeserializeJSON(t)); } }
public static IEnumerable <Alert> GetAlerts() { string Endpoint = "/alerts"; Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = RestServices.GetResponse(RequestAddress, APIKEY); List <JToken> tokens = new List <JToken>(JObject.Parse(Response).SelectTokens("alerts")); List <Alert> l = new List <Alert>(); foreach (JToken t in tokens.Children()) { yield return(Alert.DeserializeJSON(t)); } }
public XboxProfile(ProfileUser User) { ID = Convert.ToInt64(User.id); HostID = Convert.ToInt64(User.hostId); //SponsoredUser = User.isSponsoredUser; foreach (Setting s in User.settings) { switch (s.id) { case "GameDisplayPicRaw": GamerPic = new Uri(s.value); break; case "Gamerscore": Gamerscore = Convert.ToInt32(s.value); break; case "Gamertag": Gamertag = s.value; break; case "AccountTier": AccountTier = s.value; break; case "XboxOneRep": Reputation = s.value; break; case "PreferredColor": string ColorJSON = RestServices.GetResponse(new Uri(s.value)); PreferredColor = PreferredColor.DeserializeJSON(ColorJSON); break; case "RealName": RealName = s.value; break; case "Bio": Bio = s.value; break; case "Location": Location = s.value; break; default: break; } } }
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 void RemoveFriend(string xuid) { string Endpoint = string.Format("/friends/remove/{0}", xuid); Uri RequestAddress = new Uri(string.Format("{0}{1}", BASEURI, Endpoint)); string Response = RestServices.GetResponse(RequestAddress, APIKEY); }
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); }