Author

Topic: MtGox API (Read 2313 times)

legendary
Activity: 1904
Merit: 1002
March 24, 2012, 08:09:00 PM
#9
The ruby code seems to use the 0 API?

Yes, looking at the code it does appear to be the case.  However, you should be able to add a method to client.rb and call get or post on any URL you'd like.  Any more questions to bug me with during my vacation?
legendary
Activity: 965
Merit: 1000
March 24, 2012, 08:03:53 PM
#8
The ruby code seems to use the 0 API?
legendary
Activity: 1904
Merit: 1002
March 24, 2012, 07:38:24 PM
#7
Is there more info available on format of the returned json data? I.e. the structure of the open orders.

TIA,
Andreas


Use a puts or look at the code to see how the json is parsed.
legendary
Activity: 965
Merit: 1000
March 24, 2012, 12:11:57 PM
#6
Is there more info available on format of the returned json data? I.e. the structure of the open orders.

TIA,
Andreas
legendary
Activity: 1904
Merit: 1002
March 06, 2012, 07:03:34 PM
#5
I have been trying to get the mtgox gem authentication to work, using ruby 1.9.2.  I attempted the examples in the Readme.  Specifically,

Code:
MtGox.configure do |config|
  config.key = [my key]
  config.secret = [my secret]
end

# Cancel order #1234567890
MtGox.cancel 1234567890

After calling MtGox.cancel(...) Mt. Gox returns:

Code:
{"error":"Must be logged in"}

Did the API change such that the MtGox gem is no longer functional for authenticated functions?


Still works for me, with 1.9.2.  Make sure your credentials are correct and that the key pair has the correct permissions on MtGox's site.  Also, ensure your gem version is at least 0.7.3 (latest is 0.7.4).
newbie
Activity: 48
Merit: 0
March 06, 2012, 06:33:44 PM
#4
I have been trying to get the mtgox gem authentication to work, using ruby 1.9.2.  I attempted the examples in the Readme.  Specifically,

Code:
MtGox.configure do |config|
  config.key = [my key]
  config.secret = [my secret]
end

# Cancel order #1234567890
MtGox.cancel 1234567890

After calling MtGox.cancel(...) Mt. Gox returns:

Code:
{"error":"Must be logged in"}

Did the API change such that the MtGox gem is no longer functional for authenticated functions?
legendary
Activity: 1904
Merit: 1002
November 19, 2011, 08:21:35 PM
#3
New pull request is here:
https://github.com/sferik/mtgox/pull/11

Should be merged soon, and hopefully he'll make a release of the gem.

I fixed up the specs to use the new authentication scheme and fixed a small bug I introduced.
legendary
Activity: 1904
Merit: 1002
November 19, 2011, 02:33:57 AM
#2
Update: Magical Incantation found!

The link now shows working code.  Feel free to use this repo if you need to use mtgox from Ruby.  I've submitted a pull request to the original author here: https://github.com/sferik/mtgox/pull/10

171dH9Uum6wWLSwH2g8g2yto6SG7NEGyXG if you would like to show some gratitude.
legendary
Activity: 1904
Merit: 1002
November 19, 2011, 01:29:54 AM
#1
I'm trying to update the mtgox ruby gem to use the new authentication mechanism, but I can't seem to get it to work.

My request.rb with key and signature header generation is here:
https://github.com/yrral86/mtgox/blob/master/lib/mtgox/request.rb

post('/api/0/buyBTC.php', {:amount => amount, :price => price})
gives me:
{"error"=>"Must be logged in"}

I've also tried calling Base64.decode64 on the secret before passing it into the hash function.  Same result.

Any MtGox API gurus out there?  Even just an example secret, message, and hash tuple would be helpful to make sure the signature process is correct.
Jump to: