Hello everyone,
this is my call i am trying to do with java and it returns an error (HttpClientErrorException $ Unauthorized: 401)
What am I doing wrong ???
the API key is correct
I look forward to thank you very much in advance: D
NewOrder newOrder = new NewOrder(“USDTSHIB”,OrderSide.SELL, OrderType.STOP_LOSS, TimeInForce.GTC,“5.0”,“0.01”).stopPrice(“0.001”);
URI uri = UriComponentsBuilder.fromHttpUrl(endPointBinance + pathNewOcoOrder).build().toUri();
HttpHeaders headers = new HttpHeaders();
headers.set(“Content-Type”, MediaType.APPLICATION_JSON_VALUE);
headers.set(“X-MBX-APIKEY”,API_KEY);
HttpEntity entity = new HttpEntity(newOrder,headers);
ResponseEntity response =
restTemplate.exchange(uri, HttpMethod.POST, entity, new ParameterizedTypeReference() {
});