static async Task GetCacheGroupID(string authtoken) { Uri GetCacheGroupIDUri = new Uri("https://update.xboxlive.com/GetCacheGroupId"); HttpClient client = new HttpClient(); client.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", authtoken); client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json"); HttpResponseMessage httpResponse = await client.GetAsync(GetCacheGroupIDUri); if (httpResponse.IsSuccessStatusCode) { string temp = httpResponse.Content.ReadAsStringAsync().Result; var cachejson = CacheGroupId.FromJson(temp); if (cachejson.PurpleCacheGroupId != "") { Console.WriteLine($"Cache ID Found: {cachejson.PurpleCacheGroupId}"); } } }
public static string ToJson(this CacheGroupId self) => JsonConvert.SerializeObject(self, Converter.Settings);