-1

my code is:

HitBtcApi.HitBtcApi hitbtc = new HitBtcApi.HitBtcApi();
hitbtc.Authorize("xxx", "xxx");            
RestRequest request2 = new RestRequest("/api/2/account/balance", method.GET);
var x= await hitbtc.Execute(request2, true);    
MessageBox.Show(x.content.ToString());

this error rising when running: {"error":{"code":1001,"message":"Authorization required","description":""}} but when i use "/api/2/public/symbol" instead of "/api/2/account/balance" it work. please help me. thanks.

Jongware
  • 22,200
  • 8
  • 54
  • 100

1 Answers1

0

enter image description hereDid you activate the access right to the specific API for your API key?

https://hitbtc.com/settings/api-keys

using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Authorization = new
                    System.Net.Http.Headers.AuthenticationHeaderValue("Basic",
                        Convert.ToBase64String(
                            Encoding.ASCII.GetBytes(
                                "user:pass")));

                var result = await (await client.GetAsync("https://api.hitbtc.com/api/2/trading/balance")).Content
                    .ReadAsStringAsync();
            }
Khatibzadeh
  • 460
  • 3
  • 10