When i use api method private/create-withdrawal on crypto.com exchange i get error: "code":10002,"message":"UNAUTHORIZED". I am using this request with axios:
url: 'https://api.crypto.com/v2/private/create-withdrawal',
method: 'post',
headers: { 'Content-Type': 'application/json' },
data: '{"id":"1679053143058","method":"private/create-withdrawal","params":{
"currency":"1INCH",
"amount":"25",
"address":"********",
"network_id":"ETH"},
"api_key":"********",
"sig":"*********",
"nonce":"1679053143058"}'
}
Parametr sig is in lower case. I also used method that creates signature in method private/get-currency-networks (with empty params) and it worked. How to fix this?
url: 'https://api.crypto.com/v2/private/create-withdrawal',
method: 'post',
headers: { 'Content-Type': 'application/json' },
data: '{"id":"1679053143058","method":"private/create-withdrawal","params":{"currency":"1INCH","amount":"25","address":"********","network_id":"ETH"},"api_key":"********","sig":"*********","nonce":"1679053143058"}'
}
Found a problem. You need to text to cryptocom support and ask to activate withdraw function (it`s disabled by default).