Bitcoin Forum
November 06, 2024, 12:25:10 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Blockchain api key  (Read 174 times)
freeman1177 (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
June 28, 2018, 12:37:06 PM
 #1

I received an api key from blockchain, I'm using it to create unique addresses so I can receive payments, how do I link that api key to my blockchain wallet account
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
June 28, 2018, 12:54:29 PM
 #2

It should already be linked if you got it from your account on blockchain's website.
TryNinja
Legendary
*
Offline Offline

Activity: 3010
Merit: 7434


Top Crypto Casino


View Profile WWW
June 28, 2018, 03:48:35 PM
Last edit: June 29, 2018, 01:11:18 AM by TryNinja
 #3

Install and run the local service and make the requests to it.

The base URL for all requests is: https://blockchain.info/merchant/$guid/ "https://localhost:3000/merchant/$guid" where $guid is your Blockchain Wallet ID (used to login), and you should use the parameter "?password=main_password" where main_password is your wallet password.

Here is an example for PHP:
Code:
<?

$guid="GUID_HERE"; // YOUR WALLET ID
$firstpassword="PASSWORD_HERE"; // YOUR PASSWORD
$secondpassword="PASSWORD_HERE"; // SECOND PASSWORD IF YOUR ACCOUNT HAS DOUBLE ENCRYPTION ENABLED
$amounta = "10000000";
$amountb = "400000";
$addressa = "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq";
$addressb = "1ExD2je6UNxL5oSu6iPUhn9Ta7UrN8bjBy";
$recipients = urlencode('{
                  "'.$addressa.'": '.$amounta.',
                  "'.$addressb.'": '.$amountb.'
               }');

$json_url = "http://localhost:3000/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;

?>

Source: https://www.blockchain.com/pt/api/blockchain_wallet_api

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
freeman1177 (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
June 28, 2018, 04:54:09 PM
 #4

I'm getting NULL when running the code:

https://blockchain.info/merchant/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/sendmany?password=xxxxxx&second_password=xxxxxx&recipients=%7B%0D%0A++++++++++++++++++%221NfGMB5DNVitjvUKk2UJw2iZH28sAGP6XX%22%3A+600%0D%0A+++++++++++++++%7D

NULL



Code:
$guid="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; 
$firstpassword="xxxxxxxxxxx";
$secondpassword="xxxxxxxxxxx";
$amounta = "600";
$addressa = "1NfGMB5DNVitjvUKk2UJw2iZH28sAGP6XX";
$recipients = urlencode('{
                  "'.$addressa.'": '.$amounta.'
               }');

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

echo $json_url."\n";

$json_data = file_get_contents($json_url);
$json_feed = json_decode($json_data);

var_export($json_feed);
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
June 28, 2018, 10:15:11 PM
 #5

Don't you have to install a service on your local machine to use the API? Huh
To use this API, you will need to run small local service which be responsible for managing your Blockchain Wallet. Your application interacts with this service locally via HTTP API calls.
Click here for complete setup instructions on GitHub.

I don't think you can connect to: https://blockchain.info/merchant

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
TryNinja
Legendary
*
Offline Offline

Activity: 3010
Merit: 7434


Top Crypto Casino


View Profile WWW
June 29, 2018, 01:08:23 AM
 #6

@HCP is right. I edited my original post.

The https://blockchain.info/merchant/xxxxxxx keeps redirecting you back to the Blockchain API doc page.

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
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!