Author

Topic: Help with Blockchain API sendmany (Read 1396 times)

sr. member
Activity: 527
Merit: 250
March 16, 2013, 02:20:35 PM
#12
mrvision, have you tried using your main wallet address?
Yes, and it used to work... but no longer i don't know why :S
newbie
Activity: 13
Merit: 0
March 15, 2013, 06:56:40 PM
#11
mrvision, have you tried using your main wallet address?
sr. member
Activity: 527
Merit: 250
March 14, 2013, 01:24:28 PM
#10
Today i'm having a problem with sendmany. If i put &from= and one of my bitcoin addresses the response it gives me is:
{"error":"You must provide at least one or more from addresses"}

If i don't put the from variable it does the job, but i want to specify the address Sad

can you help me piuk?
newbie
Activity: 13
Merit: 0
February 18, 2013, 11:26:20 PM
#9
Thanks piuk, Do I need to urlencode() the whole string I'm requesting or just the list of recipients?

when I add urlencode() it formats my $recipient string to this:

%7B%22add1%22%3A65400%2C%22add2%22%3A65400%7D

When I send it off to get_file_contents() or use the string in a browser I still get "Unknown Error"

The browser then translates it back to:

{%22add1%22%3A65400%2C%22add2%22%3A65400}
hero member
Activity: 910
Merit: 1005
February 18, 2013, 08:10:30 PM
#8
Please try urlencode($recipients) e.g.

Quote

    foreach($payments as $addr){
        $add = $addr['add'];
        $addresses[add] = $addr['amount'] * 100000000;
    }

    $recipients = urlencode(json_encode($addresses));

    https://blockchain.info/merchant/$guid/sendmany?password=$pass&second_password=$pass2&recipients=$recipients&anonymous=false&fee=50000

If that doesn't work I will take a look for server side issues.
newbie
Activity: 13
Merit: 0
February 18, 2013, 07:58:43 PM
#7
Sorry I left out the request, I'm using file_get_contents().
full member
Activity: 154
Merit: 100
February 18, 2013, 07:55:52 PM
#6
Quote
Are you URL encoding the recipients JSON?

I think  Huh I'm doing this correctly, here is my code:

Code:
   foreach($payments as $addr){
        $add = $addr['add'];
        $addresses[add] = $addr['amount'] * 100000000;
    }
    $recipients = json_encode($addresses);

    https://blockchain.info/merchant/$guid/sendmany?password=$pass&second_password=$pass2&recipients=$recipients&anonymous=false&fee=50000
But what is actually performing the request? For instance, if you paste your original request into a browser, the browser will replace all the quotes with %22
newbie
Activity: 13
Merit: 0
February 18, 2013, 07:38:03 PM
#5
Quote
Are you URL encoding the recipients JSON?

I think  Huh I'm doing this correctly, here is my code:

Code:
   foreach($payments as $addr){
        $add = $addr['add'];
        $addresses[add] = $addr['amount'] * 100000000;
    }
    $recipients = json_encode($addresses);

    $url = "https://blockchain.info/merchant/".$guid."/sendmany?password=".$pass."&second_password=".$pass2."&recipients=".$recipients."&anonymous=false&fee=50000"
    $response = file_get_contents($url);

hero member
Activity: 910
Merit: 1005
February 18, 2013, 07:28:36 PM
#4
yep, I've tried removing the quotes from the numbers and get {"error":"Unknown Error"}

Are you URL encoding the recipients JSON?
newbie
Activity: 13
Merit: 0
February 18, 2013, 07:19:25 PM
#3
yep, I've tried removing the quotes from the numbers and get {"error":"Unknown Error"}
full member
Activity: 154
Merit: 100
February 18, 2013, 07:14:10 PM
#2
Hey,

Using PHP I've had success using the "payment" method and now trying to use "sendmany".

This is my request I'm using.
https://blockchain.info/merchant/$guid/sendmany?password=$pass&second_password=$pass2&recipients={"add1":"65400","add2":"65400"}&anonymous=false&fee=50000

And I keep getting this error:
{"error":"java.lang.String cannot be cast to java.lang.Long"}

Have I formatted the recipients incorrectly?
I've tried removing the "quotes" from the amounts but get the unknown error

Here is the documentation:
https://blockchain.info/api/blockchain_wallet_api

Any ideas?


Try removing the quotes from the numbers in the recipients?
newbie
Activity: 13
Merit: 0
February 18, 2013, 06:52:28 PM
#1
Hey,

Using PHP I've had success using the "payment" method and now trying to use "sendmany".

This is my request I'm using.
https://blockchain.info/merchant/$guid/sendmany?password=$pass&second_password=$pass2&recipients={"add1":"65400","add2":"65400"}&anonymous=false&fee=50000

And I keep getting this error:
{"error":"java.lang.String cannot be cast to java.lang.Long"}

Have I formatted the recipients incorrectly?
I've tried removing the "quotes" from the amounts but get the unknown error

Here is the documentation:
https://blockchain.info/api/blockchain_wallet_api

Any ideas?

Jump to: