Bitcoin Forum

Other => Beginners & Help => Topic started by: Jessynoo on June 22, 2011, 01:29:37 PM



Title: Tradehill API - {"error":"Not logged in."}
Post by: Jessynoo on June 22, 2011, 01:29:37 PM
Hi,

I'm having trouble using the Tradehill test APIs.
I'm using a .Net Client, ServicePointManager.ServerCertificateValidationCallback was set to a true returning delegate to bypass SSL issue.

No pb retrieving the Ticker with a Get request:{"ticker": {"sell": "11.9999000000", "buy": "61.0000000000", "last": "11.9999", "vol": "0", "high": "0", "low": "0"}}

But when posting to https://api-test.tradehill.com/APIv1/USD/GetOrders with name=myemail and pass=mypwd I get {"error":"Not logged in."}
Similar Bot works fine on getOrders, buyBTC and sellBTC on MtGox API

Has anyone experienced that problem?
Any successful attempts?

Thanks in advance for your advices.


Title: Re: Tradehill API - {"error":"Not logged in."}
Post by: Jessynoo on June 23, 2011, 04:38:01 PM
I suppose the authenticated API was down before the announcement was made.
Looking forward to testing some more.


Title: Re: Tradehill API - {"error":"Not logged in."}
Post by: boaz2020 on July 02, 2011, 07:56:12 PM
This is still happening to me, anyone else?


Title: Re: Tradehill API - {"error":"Not logged in."}
Post by: Jessynoo on July 03, 2011, 12:57:05 AM
You need to have your account activated by email, and then you'll be able to connect to the test api urls only, with your email for both username and password.
Forgot the latter explained in your activation email.
Now I can get my balance and orders, but then the format is too different from mtgox for a simple String transform as with exchangebitoins.com + all numbers are Strings.
I guess 'm up for loading a JsonObject and doing the fitting in memory. Any other idea?


Title: Re: Tradehill API - {"error":"Not logged in."}
Post by: runlinux on July 03, 2011, 01:12:06 AM
you also have to send the request as a POST

for example (VB .Net):

Used to move coins from your MTGox account to your wallet

Code:
        Dim postString As String
        Dim postArray() As Byte

        postString = "name=" & username & "&pass=" & password & "&group1=BTC" & "&btca= " & address & "&amount=" & amount
        postArray = System.Text.Encoding.GetEncoding(1252).GetBytes(postString)

        myURL = "https://mtgox.com/code/withdraw.php?"

        winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
        winHttpReq.settimeouts(60000, 60000, 60000, 60000)
        winHttpReq.Open("POST", myURL, False)
        winHttpReq.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
        winHttpReq.Send(postArray)
        html = winHttpReq.responseText