Bitcoin Forum
December 03, 2016, 04:57:31 AM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: MtGox API  (Read 2140 times)
notme
Legendary
*
Offline Offline

Activity: 1526


View Profile
November 19, 2011, 06: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.

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
12jh3odyAAaR2XedPKZNCR4X4sebuotQzN
1480741051
Hero Member
*
Offline Offline

Posts: 1480741051

View Profile Personal Message (Offline)

Ignore
1480741051
Reply with quote  #2

1480741051
Report to moderator
1480741051
Hero Member
*
Offline Offline

Posts: 1480741051

View Profile Personal Message (Offline)

Ignore
1480741051
Reply with quote  #2

1480741051
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1480741051
Hero Member
*
Offline Offline

Posts: 1480741051

View Profile Personal Message (Offline)

Ignore
1480741051
Reply with quote  #2

1480741051
Report to moderator
1480741051
Hero Member
*
Offline Offline

Posts: 1480741051

View Profile Personal Message (Offline)

Ignore
1480741051
Reply with quote  #2

1480741051
Report to moderator
1480741051
Hero Member
*
Offline Offline

Posts: 1480741051

View Profile Personal Message (Offline)

Ignore
1480741051
Reply with quote  #2

1480741051
Report to moderator
notme
Legendary
*
Offline Offline

Activity: 1526


View Profile
November 19, 2011, 07: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.

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
12jh3odyAAaR2XedPKZNCR4X4sebuotQzN
notme
Legendary
*
Offline Offline

Activity: 1526


View Profile
November 20, 2011, 01:21:35 AM
 #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.

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
12jh3odyAAaR2XedPKZNCR4X4sebuotQzN
is4tomj
Jr. Member
*
Offline Offline

Activity: 48



View Profile WWW
March 06, 2012, 11: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?

http://BitcoinTitan.com - Visualizations of the Bitcoin Markets and Exchanges
notme
Legendary
*
Offline Offline

Activity: 1526


View Profile
March 07, 2012, 12:03:34 AM
 #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).

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
12jh3odyAAaR2XedPKZNCR4X4sebuotQzN
daybyter
Legendary
*
Offline Offline

Activity: 965


View Profile
March 24, 2012, 05: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

notme
Legendary
*
Offline Offline

Activity: 1526


View Profile
March 25, 2012, 12:38:24 AM
 #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.

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
12jh3odyAAaR2XedPKZNCR4X4sebuotQzN
daybyter
Legendary
*
Offline Offline

Activity: 965


View Profile
March 25, 2012, 01:03:53 AM
 #8

The ruby code seems to use the 0 API?

notme
Legendary
*
Offline Offline

Activity: 1526


View Profile
March 25, 2012, 01:09:00 AM
 #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?

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
12jh3odyAAaR2XedPKZNCR4X4sebuotQzN
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!