Error 401 on OCO call Unauthorized: 401

Hello everyone,

I’m trying to make a POST call with ResTemplate in java.
The parameters have already been checked and are ok, i think i am wrong to use the ResTemplate.

String body = “?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559”;

	String code = encode(API_KEY,body);"START -- code ", code );

	body += "&signature="+code;
	HttpEntity entity = new HttpEntity(body,headers);

	ResponseEntity<String> response =, HttpMethod.POST, entity, new ParameterizedTypeReference<>() {

I receive this error:
org.springframework.web.client.HttpClientErrorException$Unauthorized: 401

Someone can help me?
Thanks :slight_smile:

Hi @Andrea_Rubino, we don’t debug personal codes, but we have this java examples which hopefully can be helpful for you to discover the issue: binance-signature-examples/java at master · binance/binance-signature-examples · GitHub