Author

Topic: BlockChain.info SendMany API - Need Help (Read 658 times)

hero member
Activity: 1582
Merit: 759
May 22, 2014, 06:05:26 PM
#7
The one u have mentioned from the blockchain.info send API does not have the 'note' param. If include the 'note' param in the json_url, it'll eventually throw an error at file_get_contents, where the jso_url is parsed.

I was, more or less, just posting a template for use.
What error would it return. I don't see a reason as to why it would return an error provided he uses

Code:
urlencode($note);

before providing the note.

Therefore:
This is just a test note
would turn into:
This%20is%20a%20test%20note

and would be accepted by BlockChain.info.

As an example: The code should be along the lines of:

Code:
$note = urlencode("NOTE HERE");
$guid="GUID_HERE";
$firstpassword="PASSWORD_HERE";
$secondpassword="PASSWORD_HERE";
$amounta = "10000000";
$amountb = "400000";
$addressa = "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq";
$addressb = "1ExD2je6UNxL5oSu6iPUhn9Ta7UrN8bjBy";
$recipients = urlencode('{
                  "'.$addressa.'": '.$amounta.',
                  "'.$addressb.'": '.$amountb.'
               }');

$json_url = "http://blockchain.info/merchant/$guid/sendmany?password=$firstpassword&second_password=$secondpassword&recipients=$recipients¬e=$note";

$json_data = file_get_contents($json_url);

$json_feed = json_decode($json_data);

$message = $json_feed->message;
$txid = $json_feed->tx_hash;

?>
legendary
Activity: 2394
Merit: 1216
The revolution will be digital
the problem is, I think, '¬' of ¬e represents an ASCII character and hence HTTP get is unable to take this param.

Which then begs the question: Why is he using an API url within Html.

You should be sending the request to the BlockChain.info servers using a programming language such as PHP.
Example:

Code:

$guid="GUID_HERE";
$firstpassword="PASSWORD_HERE";
$secondpassword="PASSWORD_HERE";
$amounta = "10000000";
$amountb = "400000";
$addressa = "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq";
$addressb = "1ExD2je6UNxL5oSu6iPUhn9Ta7UrN8bjBy";
$recipients = urlencode('{
                  "'.$addressa.'": '.$amounta.',
                  "'.$addressb.'": '.$amountb.'
               }');

$json_url = "http://blockchain.info/merchant/$guid/sendmany?password=$firstpassword&second_password=$secondpassword&recipients=$recipients";

$json_data = file_get_contents($json_url);

$json_feed = json_decode($json_data);

$message = $json_feed->message;
$txid = $json_feed->tx_hash;

?>

The one u have mentioned from the blockchain.info send API does not have the 'note' param. If include the 'note' param in the json_url, it'll eventually throw an error at file_get_contents, where the jso_url is parsed.
hero member
Activity: 1582
Merit: 759
the problem is, I think, '¬' of ¬e represents an ASCII character and hence HTTP get is unable to take this param.

Which then begs the question: Why is he using an API url within Html.

You should be sending the request to the BlockChain.info servers using a programming language such as PHP.
Example:

Code:

$guid="GUID_HERE";
$firstpassword="PASSWORD_HERE";
$secondpassword="PASSWORD_HERE";
$amounta = "10000000";
$amountb = "400000";
$addressa = "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq";
$addressb = "1ExD2je6UNxL5oSu6iPUhn9Ta7UrN8bjBy";
$recipients = urlencode('{
                  "'.$addressa.'": '.$amounta.',
                  "'.$addressb.'": '.$amountb.'
               }');

$json_url = "http://blockchain.info/merchant/$guid/sendmany?password=$firstpassword&second_password=$secondpassword&recipients=$recipients";

$json_data = file_get_contents($json_url);

$json_feed = json_decode($json_data);

$message = $json_feed->message;
$txid = $json_feed->tx_hash;

?>
legendary
Activity: 2394
Merit: 1216
The revolution will be digital
the problem is, I think, '¬' of ¬e represents an ASCII character and hence HTTP get is unable to take this param.
hero member
Activity: 1582
Merit: 759
It might be an issue with a limit of the GET request.

Did an error come up to show the payment did not go through. Can you post the error here (obv don't if it contains secret information).
legendary
Activity: 2226
Merit: 1052
Looks like the 'note' param has got the problem. None is using this feature ?

Code:
https://blockchain.info/merchant/$guid/payment?password=$main_password&second_password=$second_password&to=$address&amount=$amount&from=$from&shared=$shared&fee=$fee¬e=$note
legendary
Activity: 2226
Merit: 1052
I am trying to send transaction to many people from a wallet using blockchain.info SendMany API. I am using the following URL for the same...

Code:
http://blockchain.info/merchant/$guid/sendmany?password=$firstpassword&recipients=$recipients¬e=$note

Source: https://blockchain.info/api/api_send

As long as I'm not using ¬e=$note, but it stops working when I include this to have a public note attached. Anyone knows how to overcome this ? Do I need to use something else instead of 'note' as a param ? Any help in this regard is highly appreciated...
Jump to: