I am developing a Java API for Mt Gox. I have the GET methods working fine, i.e.
Ticker Data:
https://mtgox.com/code/data/ticker.phpBut I get
{"error":"Must be logged in"} when testing from Java. I can see all the details of the HTTPS communication using the curl utility on linux, which gets the same error message ...
curl -v -k --referer http://bitcoin.org --cookie-jar cookies.txt https://mtgox.com/code/data/ticker.php
curl -v -k --referer http://bitcoin.org --cookie cookies.txt --cookie-jar cookies.txt --data-urlencode "name=XXX&pass=YYY" -H "Accept: application/json" https://mtgox.com/code/getFunds.php
The first curl command gets the Mt Gox ticker OK, Note that the SESSION_ID from the ticker GET is sent back to the Mt Gox server with the subsequent POST via curl's cookie options. The second curl command responds with the above mentioned error.
I may have to resort to screen scraping the Mt Gox web pages, i.e. pretending to be a web browser if I cannot get the Mt Gox trading API to work for POSTs.
Any help would be appreciated, - if you do not know how your script works, just knowing that someone has a working script to obtain Mt Gox balances would be useful.