THe following Code is not working , Pls help what I have missed out here, Always getting following msg
"error":"You cannot login to the API with just a login and password".
Dim ApiKey = "TTTTTTTTTTTT"
Dim ApiSecretKey ="9o1AuLHkNP5fx8lxfPpzmWtjwjuwUlHL3qVfInTmjYrFjQ=="
Dim url = "
https://mtgox.com/code/cancelOrder.php"
Dim params
UserName = "raj"
Password = "raj"
Dim orderID = "1111011"
Dim ordertype = "clos"
Dim strUrl = url
Dim req As Net.HttpWebRequest = System.Net.HttpWebRequest.Create(strUrl)
req.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
req.Accept = " Application / json"
req.Headers.Add("key", ApiKey)
params.Add(Tuple.Create("nonce", DateTime.Now.Ticks.ToString()))
params.add(tuple.Create("name", UserName))
params.add(tuple.Create("pass", Password))
params.add(tuple.Create("orderID", orderID))
params.add(tuple.Create("orderType", ordertype))
If params.Count Then
req.AllowWriteStreamBuffering = True
req.Method = "POST"
req.ContentType = "application/x-www-form-urlencoded"
Dim postSB As New System.Text.StringBuilder()
For Each param In params
If postSB.Length Then postSB.Append("&")
postSB.Append(param.Item1)
postSB.Append("=")
postSB.Append(param.Item2)
Next
Dim postBin = System.Text.Encoding.ASCII.GetBytes(postSB.ToString())
If authRequired Then
Dim hmac = System.Security.Cryptography.HMACSHA512.Create()
hmac.Key = Convert.FromBase64String(ApiSecretKey)
Dim hash = hmac.ComputeHash(postBin)
req.Headers.Add("secret", Convert.ToBase64String(hash))
End If
req.GetRequestStream.Write(postBin, 0, postBin.Length)
End If
Dim response = req.GetResponse.GetResponseStream()
Dim reader As IO.StreamReader = New IO.StreamReader(response)
MsgBox(reader.ReadToEnd)
End Sub