I'm having trouble working out how to get information from the signed binance API. I'm able to call the public endpoints (for example, the server time below) but the signed endpoint is causing me a headache and I don't know where to go from here.
The binance signed API documentation mentions
that
Summary
"
SIGNED (TRADE, USER_DATA, AND MARGIN) Endpoint security
-
SIGNED
endpoints require an additional parameter,signature
, to be sent in thequery string
orrequest body
. - Endpoints use
HMAC SHA256
signatures. TheHMAC SHA256 signature
is a keyedHMAC SHA256
operation. Use yoursecretKey
as the key andtotalParams
as the value for the HMAC operation. - The
signature
is not case sensitive. -
totalParams
is defined as thequery string
concatenated with therequest body
.
I don't really know precisely what this means, but I am passing my API key and secret, and a timestamp as below but I'm not getting the account status returned, although I am getting the servertime.
ih =InternetOpenURL("https://testnet.binance.vision/api/v3/time");
printf(" Server Time " );
if( ih )
{
while( ( str = InternetReadString( ih ) ) != "" )
{
printf( "%s", str );
}
InternetClose( ih );
}
EnableScript("jscript");
<%
string_holding_json =
{
GET "https://testnet.binance.vision/sapi/v1/capital/config/getall/ ",
×tamp= ih,
&signature= "7j0gW9J**************************I4MhPancY",
&apiKey= "ubupZKb******************************1MgM",
};
obj = JSON.parse( string_holding_json );
getall = obj.GET;
%>;
scr = GetScriptObject();
msg = scr.getall;
printf("%s", msg);
Does anyone here have any ideas how I can make this work? Thanks in advance.