Bitcoin Forum
November 06, 2024, 05:24:57 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: BlockChain.info SendMany API - Need Help  (Read 654 times)
newIndia (OP)
Legendary
*
Offline Offline

Activity: 2226
Merit: 1052


View Profile
May 17, 2014, 09:51:11 AM
 #1

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&note=$note

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

As long as I'm not using &note=$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...

newIndia (OP)
Legendary
*
Offline Offline

Activity: 2226
Merit: 1052


View Profile
May 18, 2014, 11:47:53 AM
 #2

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

Initscri
Hero Member
*****
Offline Offline

Activity: 1582
Merit: 759


View Profile WWW
May 21, 2014, 08:20:18 PM
 #3

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).

----------------------------------
Web Developer. PM for details.
----------------------------------
BitCoinDream
Legendary
*
Offline Offline

Activity: 2394
Merit: 1216

The revolution will be digital


View Profile
May 21, 2014, 09:44:57 PM
 #4

the problem is, I think, '&not' of &note represents an ASCII character and hence HTTP get is unable to take this param.

Initscri
Hero Member
*****
Offline Offline

Activity: 1582
Merit: 759


View Profile WWW
May 21, 2014, 11:50:13 PM
 #5

the problem is, I think, '&not' of &note 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;

?>

----------------------------------
Web Developer. PM for details.
----------------------------------
BitCoinDream
Legendary
*
Offline Offline

Activity: 2394
Merit: 1216

The revolution will be digital


View Profile
May 22, 2014, 10:51:06 AM
 #6

the problem is, I think, '&not' of &note 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.

Initscri
Hero Member
*****
Offline Offline

Activity: 1582
Merit: 759


View Profile WWW
May 22, 2014, 11: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&note=$note";

$json_data = file_get_contents($json_url);

$json_feed = json_decode($json_data);

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

?>

----------------------------------
Web Developer. PM for details.
----------------------------------
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!