I am calling https://testnet.binancefuture.com/sapi/v1/account/apiRestrictions to get key restrictions. I send the api key in header X-MBX-APIKEY, and signature as a parameter. i get the parameter as follows:
signString(apiSecret) {
const query_string = `timestamp=${Date.now()}`;
return crypto
.createHmac('sha256', apiSecret)
.update(query_string)
.digest('hex');
}
The api is not available - We can’t connect to the server.
I tried doing that through ccxt library too, but i receive the error - binance does not have a testnet/sandbox URL for sapi endpointsю
How do I connect to binance future testnet to get api key restrictions and then trade?
SAPI endpoints are under the SPOT Testnet not the Futures Testnet.
The SPOT Testnet is accessible using different credentials and is hosted under a different url.
Follow the testnet integration guide for further help
https://testnet.binance.vision/
I tried then https://testnet.binance.vision/api/v1/account/apiRestrictions
With the keys created on https://testnet.binance.vision/
I receive a 403 error. Same api key header and signature parameter.
The full error (in plain html):
403 ERROR
The request could not be satisfied.
Bad request. We can’t connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
The API Permissions endpoint has /sapi/v1/account/apiRestrictions as a path not /api/v1/account/apiRestrictions
Also, please note /sapi/* endpoints are not supported on testnet.
Also, please note /sapi/* endpoints are not supported on testnet.
was not sure about that, thank you.