Title: Problem API von Bitstamp -> {"error": "Missing key, signature and nonce paramete Post by: Wolke on November 14, 2014, 07:31:19 PM hey,
kann hier jemand helfen - bekommen den fehler hier: Code: {"error": "Missing key, signature and nonce parameters"} unser code: Code: Dim api_key As String = "APIXXXXXXXXXXXXXXXXXX" Dim api_secret As String = "APIXXXXXXXXXXXXXXXXXX" Dim client_id As String = "01020304" Public Function check_balance() Try Dim NONCE As String = DateTime.Now.Ticks Dim SIGNATURE As String = CreateSignature(NONCE) Dim request As HttpWebRequest request = DirectCast(WebRequest.Create("https://www.bitstamp.net/api/balance/"), HttpWebRequest) request.Method = "POST" request.Headers("key") = api_key request.Headers("nonce") = NONCE request.Headers("signature") = SIGNATURE Dim response As HttpWebResponse = Nothing Dim reader As StreamReader = Nothing Dim result As String = Nothing Try response = DirectCast(request.GetResponse(), HttpWebResponse) reader = New StreamReader(response.GetResponseStream()) result = reader.ReadToEnd() MsgBox(result) Catch ex As Exception Return ex.ToString() Finally If Not response Is Nothing Then response.Close() End Try Return result Catch ex As Exception MsgBox(ex.ToString) End Try End Function Private Function CreateSignature(ByVal Nonce As String) As String Dim msg As String = String.Format("{0}{1}{2}", Nonce, client_id, api_key) Return ByteArrayToString(SignHMACSHA256(api_secret, StringToByteArray(msg))).ToUpper() End Function Private Function SignHMACSHA256(key As [String], data As Byte()) As Byte() Dim hashMaker As New HMACSHA256(Encoding.ASCII.GetBytes(key)) Return hashMaker.ComputeHash(data) End Function Private Function StringToByteArray(str As String) As Byte() Return System.Text.Encoding.ASCII.GetBytes(str) End Function Private Function ByteArrayToString(hash As Byte()) As String Return BitConverter.ToString(hash).Replace("-", "").ToLower() End Function würden uns über tipps oder lösungen sehr freuen... :) Title: Re: Problem API von Bitstamp -> {"error": "Missing key, signature and nonce paramete Post by: LOBSTER on November 14, 2014, 07:36:12 PM Liegt wohl an der Authentication.
Bitstamp sagt dazu folgendes: Quote Signature is a HMAC-SHA256 encoded message containing: nonce, client ID and API key. The HMAC-SHA256 code must be generated using a secret key that was generated with your API key. This code must be converted to it's hexadecimal representation (64 uppercase characters). Example (Python): message = nonce + client_id + api_key signature = hmac.new(API_SECRET, msg=message, digestmod=hashlib.sha256).hexdigest().upper() Title: Re: Problem API von Bitstamp -> {"error": "Missing key, signature and nonce paramete Post by: Wolke on November 16, 2014, 12:21:10 PM kann gelöscht werden -> habe jemand gefunden der super geholfen hat....
|