Binance connector account method => Signature for this request is not valid.

Hi there!

When I try to use the account method (/api/v3/account) on spot testnet (https://testnet.binance.vision) I get :

binance.error.ClientError: (400, -1022, ‘Signature for this request is not valid.’, {‘Content-Type’: ‘application/json;charset=UTF-8’, ‘Content-Length’: ‘63’, ‘Connection’: ‘keep-alive’, ‘Date’: ‘Sat, 03 Sep 2022 18:53:53 GMT’, ‘Server’: ‘nginx’, ‘x-mbx-uuid’: ‘4c0b1ee9-3eff-452d-bffc-be6d1796c396’, ‘x-mbx-used-weight’: ‘10’, ‘x-mbx-used-weight-1m’: ‘10’, ‘Strict-Transport-Security’: ‘max-age=31536000; includeSubdomains’, ‘X-Frame-Options’: ‘SAMEORIGIN’, ‘X-Xss-Protection’: ‘1; mode=block’, ‘X-Content-Type-Options’: ‘nosniff’, ‘Content-Security-Policy’: “default-src ‘self’”, ‘X-Content-Security-Policy’: “default-src ‘self’”, ‘X-WebKit-CSP’: “default-src ‘self’”, ‘Cache-Control’: ‘no-cache, no-store, must-revalidate’, ‘Pragma’: ‘no-cache’, ‘Expires’: ‘0’, ‘X-Cache’: ‘Error from cloudfront’, ‘Via’: ‘1.1 f71686f416809921055425c79026dd70.cloudfront.net (CloudFront)’, ‘X-Amz-Cf-Pop’: ‘CDG50-P1’, ‘X-Amz-Cf-Id’: ‘SdyEdptG2Xi-neJD2_Sv1ry0tJATEIBobj-dcXEO8MCWYRXI5r3BdA==’})

Other request such as listen key seems to work fine.

Any clue on how to solve this ?

I made the same test on https://api.binance.com/api/v3/account with a regular account and it’s working fine, so I guess the endpoint is not available on test net ? But I wonder about the bad signature message…

I have the same issue when I try to post an order on SPOT testnet… Is the SPOT testnet really this useless ? I must have missed something … any help would be really appreciated.

And I don’t think it’s an issue with my keys because when I use wrong keys I get a differten message : ‘Invalid API-key, IP, or permissions for action.’

When you say Binance connector, do you mean any specific library written in certain languages that interacts with our API?

  1. Are you using the API key and secret Key obtained from the testnet site under Authenticate section? ( https://testnet.binance.vision/)
  2. Are you calculating signature correctly? There are some examples here (GitHub - binance/binance-signature-examples: Examples of binance hmac hashing)

Thanks for the answer!

Yes I mean the binance-connector lib proposed on the binance API SDK page:
https://binance-docs.github.io/apidocs/spot/en/#api-library

  1. Yes I’m using API and secret generated for testnet
  2. Well the lib is doing the job with the method sign_request and then send_request here: binance-connector-python/api.py at master · binance/binance-connector-python · GitHub