public async Task CreateApiServiceAsync() { if (_apiService == null) { var token = await TcgApiService.Authorize(_publicKey, _privateKey); _apiService = TcgApiService.CreateDefaultApi(token); } }
public static async Task Main() { // Create Token var publicKey = ""; var privateKey = ""; var userAgent = ""; var token = await TcgApiService.Authorize(publicKey, privateKey, userAgent); // Create ApiService var apiService = TcgApiService.CreateDefaultApi(token); // Create Request var @params = new ListAllGroupsDetailsGETRequestParams { CategoryId = 1 }; var result = await apiService.Execute(TcgApiUrls.Catalog.ListAllGroupsDetails, @params); Console.WriteLine(JsonConvert.SerializeObject(result, Formatting.Indented)); Console.ReadKey(); }