These Crypto API's are going to be the death of me. Finally have Binance API sorted and the Signature working. But now when all the variable are passed I get the error -1104 below.
{"code":-1104,"msg":"Not all sent parameters were read; read '4' parameter(s) but was sent '5'."}
I am certain it is the Signature Variable.
BINANCE API NOTES : SIGNED (TRADE and USER_DATA) Endpoint security
SIGNED endpoints require an additional parameter, signature, to be sent in the query string or request body.
Endpoints use HMAC SHA256 signatures.
The HMAC SHA256 signature is a keyed HMAC SHA256 operation.
Use your secretKey as the key and totalParams as the value for the HMAC operation.
The signature is not case sensitive. totalParams is defined as the query string concatenated with the request body.
This is the cfhttp send that works. This is the body being sent.
symbol=SHIBUSDT&side=sell&type=market×tamp=1645629335613&signature=1071B5C8BF8727FD465483543BC93A7FF5EBD35AC63A8219E166238E552A7867
5 parameters (symbol, side, sell, type, timestamp, signature)
<cfhttp url="#base_api##req_path#" method="POST" result="result" charset="utf-8">
<cfhttpparam type="header" name="X-MBX-APIKEY" value="#bn_key#">
<cfhttpparam type="body" value="#thebody#">
</cfhttp>
Below : This cfhttp send also works. Fore giggles I added the signature into URL Call. This is the body being sent.
symbol=SHIBUSDT&side=sell&type=market×tamp=1645629335613
5 parameters (symbol, side, sell, type, timestamp, URL ? = signature)
<cfhttp url="#base_api##req_path#?signature=XXXXXSIGSTUFFXXX" method="POST" result="result" charset="utf-8">
<cfhttpparam type="header" name="X-MBX-APIKEY" value="#bn_key#">
<cfhttpparam type="body" value="#thebody#">
</cfhttp>
Looking for fix, I seem to find that it usually a spelling error on the parameter. But these are correct parameters. Thoughts? Or is there a different way to send signature? If sent as Header it errors.