Title: MTGOX api, send simple not working. [solved ] Post by: BitvoinVender on May 22, 2013, 07:27:48 PM I found a php script for mtgox's api that is working for me.
https://github.com/daftspunk/php-mtgox-v1 here is my script, some of the functions work, some dont... Trying to get a send simple to a bitcoin address. http://pastebin.com/wihZqAcW Title: Re: MTGOX api, send simple not working. returns blank page Post by: Navles on May 22, 2013, 07:40:08 PM Hello,
Do you have OTP enabled for your account? -Navles Title: Re: MTGOX api, send simple not working. returns blank page Post by: Navles on May 22, 2013, 07:42:49 PM By the way,
I noticed MT. GOX changed their API URL from "https://mtgox.com/api/" to "https://data.mtgox.com/api/". Try changing the API base url to "https://data.mtgox.com/api/" in mtgox_api_base.php line 10. Let me know if that works. EDIT: Also dont forget to enable 'withdraw' rights in the security center. https://f.cloud.github.com/assets/738972/49695/9967f3ca-5976-11e2-903d-66674970cc0b.png -Navles Title: Re: MTGOX api, send simple not working. returns blank page Post by: BitvoinVender on May 22, 2013, 08:03:22 PM I just entered the data. and still returned a blank page.
tinkering Title: Re: MTGOX api, send simple not working. returns blank page Post by: BitvoinVender on May 22, 2013, 08:07:50 PM actually adding data. breaks the get account info as well
const api_url = 'https://data.mtgox.com/api/'; FAILD const api_url = 'https://mtgox.com/api/'; returns only on the get account into, not send simple might this have something to do with the https? Title: Re: MTGOX api, send simple not working. returns blank page Post by: Navles on May 22, 2013, 08:43:52 PM M... weird.
I'm setting up a test environment as we speak. I will get back to you in a second. -Navles Title: Re: MTGOX api, send simple not working. returns blank page Post by: Navles on May 22, 2013, 09:11:54 PM I wrote some test code and got the following exception:
"Parameter amount_int or amount is required" - Which is the default exception if something is wrong. Currently i have no BTC in my account, so i suspect that's why i get this error. Can you please try with the following code? START CODE <?php include 'mtgox_api_base.php'; include 'mtgox_private_api.php'; $private = new MtGox_Private_Api(); $private->set_currency('EUR'); // CHANGE TO USD IF YOU NEED USD!! $private->set_authentication("KEY", "SECRET"); try{ $send_simple = $private->withdraw_coins("BTC ADDRESS", "AMOUNT (eg. 0)"); print_r($send_simple); }catch(Exception $e) { print_r($e); } ?> END CODE Please let me know if this works. -Navles Title: Re: MTGOX api, send simple not working. returns blank page Post by: BitvoinVender on May 22, 2013, 10:53:41 PM used your script and getting the following error as well. ( i do have btc in the account.)
Exception Object ( [message:protected] => Parameter amount_int or amount is required [string:Exception:private] => [code:protected] => 0 [file:protected] => /var/www/admin/atm/mtgox_api_base.php [line:protected] => 79 [trace:Exception:private] => Array (
post an address and I can send some btc for testing. Title: Re: MTGOX api, send simple not working. returns blank page Post by: BitvoinVender on May 22, 2013, 11:04:19 PM if I use https://data.mtgox.com/api/
I get the following error; Exception Object ( [message:protected] => Could not get reply: Unknown SSL protocol error in connection to data.mtgox.com:443 [string:Exception:private] => [code:protected] => 0 [file:protected] => /var/www/admin/atm/mtgox_api_base.php [line:protected] => 111 [trace:Exception:private] => Array (
Title: Re: MTGOX api, send simple not working. [unsolved so added bounty .1 btc ] Post by: BitvoinVender on May 23, 2013, 02:29:44 AM *bumb added bounty
Title: Re: MTGOX api, send simple not working. [unsolved so added bounty .1 btc ] Post by: BCB on May 23, 2013, 02:31:50 AM how much is the bounty
Title: Re: MTGOX api, send simple not working. [unsolved so added bounty .1 btc ] Post by: BitvoinVender on May 23, 2013, 02:36:20 AM .1btc
my script Code: <?php is returning the error Quote Exception Object ( [message:protected] => Parameter amount_int or amount is required [string:Exception:private] => [code:protected] => 0 [file:protected] => /var/www/admin/atm/mtgox_api_base.php [line:protected] => 79 [trace:Exception:private] => Array (
Title: Re: MTGOX api, send simple not working. [unsolved so added bounty .1 btc ] Post by: BCB on May 23, 2013, 02:45:48 AM do you have otp enabled
Title: Re: MTGOX api, send simple not working. [unsolved so added bounty .1 btc ] Post by: BitvoinVender on May 23, 2013, 03:54:36 AM I do not have any 2 factor enabled;
and the key does have withdraw enabled. Title: Re: MTGOX api, send simple not working. [unsolved so added bounty .1 btc ] Post by: matt4054 on May 23, 2013, 04:03:30 AM According to the source on github, you are calling withdraw_coins() with arguments in the wrong orders.
Here's code from the API: Code: <?php You should try swapping $address and $amount_int: Code: <?php If that solves your problem, tips appreciated ;-) BTC: 13otqU1gvatwws9euEZczTXiBWhvcHUrGq Cheers, Matt Title: Re: MTGOX api, send simple not working. [unsolved so added bounty .1 btc ] Post by: BitvoinVender on May 23, 2013, 05:45:40 AM corrected order, still getting same error :/
noticed the end of the error changed when I switched them backwards 13 [function] => withdraw_coins [class] => MtGox_Private_Api [type] => -> [args] => Array (
correct 13 [function] => withdraw_coins [class] => MtGox_Private_Api [type] => -> [args] => Array (
but other then that the error is the same. (sent you a little bit for taking the time to look) :) Title: Re: MTGOX api, send simple not working. [unsolved so added bounty .1 btc ] Post by: matt4054 on May 23, 2013, 06:11:01 AM corrected order, still getting same error :/ noticed the end of the error changed when I switched them backwards 13 [function] => withdraw_coins [class] => MtGox_Private_Api [type] => -> [args] => Array (
correct 13 [function] => withdraw_coins [class] => MtGox_Private_Api [type] => -> [args] => Array (
but other then that the error is the same. (sent you a little bit for taking the time to look) :) Thanks. I looked further into the API, I don't understand how it could work. Try changing withdraw_coins() in mtgox_private_api.php this way: Code: <?php It's a quick hack out of my imagination. Tell me if it works or not, if I have time I will look further into it. Title: Re: MTGOX api, send simple not working. [unsolved so added bounty .1 btc ] Post by: BitvoinVender on May 23, 2013, 05:26:18 PM Thank you very much Matt,
That quick hack was indeed correct Title: Re: MTGOX api, send simple not working. [solved ] Post by: matt4054 on May 23, 2013, 07:00:13 PM Thank you so much for your very generous donation. It is very much appreciated, I take it as an incentive to further help you and others with coding issues involving the Gox API and PHP (had to go through this myself, with my own implementation of the JSON RPC API though).
Cheers, Matt |