Hi.
I am trying to create a simple application that allows me to interact with Poloniex Https server. To do this I must use your Api. Try to run the returnBalances command, to know my balances. The code I used was this:
When executing the command I receive a 404 error and an HTML page informing that the requested page was not found.
What could be the mistake?
If you want to test the code, you can use these keys:
Note:
Thanks.
I am trying to create a simple application that allows me to interact with Poloniex Https server. To do this I must use your Api. Try to run the returnBalances command, to know my balances. The code I used was this:
B4X:
Private Sub returnBalances
Dim command As String
command = "https://poloniex.com/tradingApi/command=returnBalances"
SendCommand("returnBalances", command, True)
End Sub
private Sub SendCommand(work As String, uri As String, Signature As Boolean)
Try
If (Signature == True)Then
Dim nonce As Long
nonce = DateTime.now
uri = uri & "&nonce=" & nonce
Dim Sign() As Byte
Sign = Https.HashHmac( uri, X_ApiSecret)
Dim API_Signed As String
Dim Byte_Conv As ByteConverter
API_Signed = Byte_Conv.HexFromBytes(Sign) 'convert to HEX
API_Signed = API_Signed.ToLowerCase
End If
Dim j As HttpJob
j.Initialize(work, Me)
j.PostString(uri, "")
If (Signature == True)Then
j.GetRequest.SetHeader("Key", X_ApiKey)
j.GetRequest.SetHeader("Sign", API_Signed)
End If
Catch
ToastMessageShow("SendCommand" & LastException, True)
End Try
End Sub
private Sub jobDone (job As HttpJob)
Dim Recibido As String
Main.error = job.ErrorMessage
CallSub2( Main, "ShowError", job.ErrorMessage)
If(job.Success) Then
'GetBalance
If(job.JobName == "returnBalances") Then
Dim parser As JSONParser
Recibido = job.GetString
CuentaData(Recibido)
parser.Initialize(Recibido)
If(Recibido.Contains("true") == True) Then
Dim root As Map = parser.NextObject
Dim result As Map = root.Get("result")
X_Available = Str2Double(result.Get("Available"))
X_Balance = Str2Double(result.Get("Balance"))
End If
End If
Else
Log(job.ErrorMessage & "/" & LastException)
End If
job.Release
End Sub
When executing the command I receive a 404 error and an HTML page informing that the requested page was not found.
What could be the mistake?
ApiKey:KE5G97MT-TH31A6TJ-IXQUK3NJ-69Q76GJG
Secret:5bdbcb41815a52a7e4427fe165ebb7718ab712ef69224b3ff42d0d0f7db8cae33c5100b14a44b4d74e26797892ea7df6d8bfaf1d947362027c726f5e6ea00bdf
Note:
- The keys are for testing purposes only and do not allow you to buy or sell cryptocurrencies or transfer funds.
- My account's Api access, is active
- Documentation about the api of poloniex here: https://docs.poloniex.com/#returnticker
Thanks.
Last edited: