'I am trying to understand what exactly is signature query parameter in binance
I am trying to access this endpoint, where signature
parameter has to be sent as query parameter
https://binance-docs.github.io/apidocs/spot/en/#current-open-orders-user_data
I am trying to understand what value for that signature
key should be passed.
Firstly i thought it was secret key binance exchange given. But it was not, because when try to above endpoint it says that :
{
"code": -1022,
"msg": "Signature for this request is not valid."
}
As you can see i passed my secret key as the value for signature key. It is not working. So what am i really missing here ? or do i need to do some transformations to the secret key ? please help me understand it and advance thanks!
Solution 1:[1]
It looks like you are putting the timestamp
before the recvWindow
in your query string.
timestamp
is always the last parameter and the order of the parameters in the docs clearly puts recvWindow
before timestamp
.
I managed to get it working with query string recvWindow=60000×tamp=1652512756366
Solution 2:[2]
Secret key and signature are two different things.
You need to sign the parameters with your secret key. This process produces a signature. And then you pass this resulting signature to the payload.
I'm not sure how to produce the signature in C++, however Binance docs show an example of signing the data in console with openssl
(scroll right on all 3 examples).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | Petr Hejda |