Author

Topic: bitcoin api problem (Read 849 times)

full member
Activity: 182
Merit: 100
October 09, 2015, 10:35:33 AM
#17
anyone here to help me with the codes . blockchain has unband me but the outputs are showing {"error":"Unknown method"} can anyone please solve this problem btw did anyone got this type of problem or i am the only one

There are some site which you can use their api:
https://bitcointalksearch.org/topic/m.12616115

Blockchain.info recently have a lot problem.
well i have already seen that thread too but anyways thank you for the suggestion
legendary
Activity: 1106
Merit: 1000
October 07, 2015, 03:37:32 AM
#16
anyone here to help me with the codes . blockchain has unband me but the outputs are showing {"error":"Unknown method"} can anyone please solve this problem btw did anyone got this type of problem or i am the only one

There are some site which you can use their api:
https://bitcointalksearch.org/topic/m.12616115

Blockchain.info recently have a lot problem.
full member
Activity: 182
Merit: 100
October 06, 2015, 10:30:31 PM
#15
anyone here to help me with the codes . blockchain has unband me but the outputs are showing {"error":"Unknown method"} can anyone please solve this problem btw did anyone got this type of problem or i am the only one
legendary
Activity: 2352
Merit: 1268
In Memory of Zepher
October 04, 2015, 12:40:53 PM
#14
Alright, what is happening here is that Blockchain has blocked the IP of your hosting provider. I'm unsure how big of a deal this is, but you will have to contact BlockChain Support to get it sorted.

Good luck with your site!
full member
Activity: 182
Merit: 100
October 04, 2015, 12:19:09 PM
#13
not improvin.g a bit. guys can anyone just make a small webpage with bitcoinaddress generator coding and pack it in a zip file and give me.I will simply study your code and try to improve my skills
Your coding isn't wrong as far as I can see. That is how I call the API on my page.

Try using this:
Code:
echo file_get_contents("https://blockchain.info/merchant/$ID/NEW_address?password=" . urlencode($PW));
And seeing what it returns.
Code:
Error 1006 Ray ID: 23028909df0f04fb • 2015-10-04
17:16:34 UTC
Access denied
What happened?
The owner of this website (blockchain.info) has banned
your IP address (31.170.160.75).
CloudFlare Ray ID: 23028909df0f04fb • Your IP:
31.170.160.75 • Performance & security by CloudFlare
thank you for helping me
legendary
Activity: 2352
Merit: 1268
In Memory of Zepher
October 03, 2015, 01:14:58 PM
#12
not improvin.g a bit. guys can anyone just make a small webpage with bitcoinaddress generator coding and pack it in a zip file and give me.I will simply study your code and try to improve my skills
Your coding isn't wrong as far as I can see. That is how I call the API on my page.

Try using this:
Code:
echo file_get_contents("https://blockchain.info/merchant/$ID/NEW_address?password=" . urlencode($PW));
And seeing what it returns.
full member
Activity: 182
Merit: 100
October 02, 2015, 09:28:19 PM
#11
not improvin.g a bit. guys can anyone just make a small webpage with bitcoinaddress generator coding and pack it in a zip file and give me.I will simply study your code and try to improve my skills
legendary
Activity: 2352
Merit: 1268
In Memory of Zepher
October 02, 2015, 12:59:37 PM
#10
A code sample from hes side would help a lot.
Code:
$ID "";
$PW "";

$newAddy json_decode(file_get_contents("https://blockchain.info/merchant/$ID/NEW_address?password=$PW"), true);

$parseAddy $newAddy[address];

echo 
$parseAddy;

?>

This is pretty much all that the OP could give us. His PHP syntax appears to be correct, so I believe that it is some kind of problem with the URL he is inputting.

OP, have you tried using the urlencode(); function on your password? I recall when I was using the API and it was bringing back errors it was due to the characters in my password. Using URL encode makes these characters into something that does not affect the URL, but still gives the desired output. Something like this could do the trick:
Code:
$newAddy = json_decode(file_get_contents("https://blockchain.info/merchant/$ID/NEW_address?password=" . urlencode($PW)), true);
sr. member
Activity: 357
Merit: 250
October 02, 2015, 12:53:16 PM
#9
snip

This is working example, tested.
By the use of /merchant/ in the URL call of the API, it looks like he is trying to use the MyWallet API, not the Recieve Payments that you have listed. I doubt that this example is very helpful, especially since that code sample is on the API documentation already.

Well, its pretty hard to determine what exactly the OP is asking from us. A code sample from hes side would help a lot. Or atleast more detailed info. Just trying to help here.
legendary
Activity: 2352
Merit: 1268
In Memory of Zepher
October 02, 2015, 12:47:34 PM
#8
snip

This is working example, tested.
By the use of /merchant/ in the URL call of the API, it looks like he is trying to use the MyWallet API, not the Recieve Payments that you have listed. I doubt that this example is very helpful, especially since that code sample is on the API documentation already.
sr. member
Activity: 357
Merit: 250
October 02, 2015, 10:14:27 AM
#7
hey friends i am trying to build a site with the bitcoin features and some of my friends suggested about the blockchain.info api to use it in the php. but after trying many things like watching tutorials from youtube or Following information from the blockchain site i am not able to make anything till now. please anyone show / make a new bitcoin address generating page so i can see where i am doing wrong or missing the peramiters or whatever mistakes i am doing

Code:
$invoice_id         = ''; // You can use any method you like to generate an unique ID for the generated wallet
$secret             = "98nb987fg0b0e2";
$my_bitcoin_address = "WALLET_ADDRESS_WHERE_TO_FORWARD_BTC_FROM_GENERATED_WALLETS";
$my_callback_url    = 'http://domain.com/callback.php?invoice_id=' .$invoice_id. '&secret='.$secret;
$root_url           = 'https://blockchain.info/api/receive';
$parameters         = 'method=create&address=' . $my_bitcoin_address .'&callback='. urlencode($my_callback_url);

$response    = file_get_contents($root_url . '?' . $parameters);
$object      = json_decode($response);

$object->input_address; // This is the Newly Generated Wallet!

This is working example, tested.
legendary
Activity: 2352
Merit: 1268
In Memory of Zepher
October 02, 2015, 04:38:54 AM
#6
when i am running it. it is not showing anything i think this is the blockchain api access problem but i have tryed to white list my ip but still it is not working.
Have you tried returning the error variable from the JSON output? Try something like this:
Code:
if($newAddy['error']){
     die($newAddy['error'];
}
If the address isn't properly generated, the only thing that will be returned is the error in the JSON.

and btw what do you mean by using arrays rather than a normal object?
Usually when I use json_decode(); I do not use the true at the end of it. It is personal preference if you do or not, as it just returns the data in a different way.

For example, if you use code like this:
Code:
$string = json_decode($JSON, true);
You get the individual variables using things like this:
Code:
$string['object'];

However, if you use it like this:
Code:
$string = json_decode($JSON);
You can get the individual variables using this:
Code:
$string->object;

It just depends what you're used to and how you code.
full member
Activity: 182
Merit: 100
October 01, 2015, 10:14:23 PM
#5
I can't see any specific problem with your code, though I don't much understand why you are using associative arrays rather than a normal object. I cannot check the syntax of the URL right now, though will try to be sure that's correct when I get home.

What sort of an error do you get? A PHP error or an error returned in the JSON object from Blockchain?
when i am running it. it is not showing anything i think this is the blockchain api access problem but i have tryed to white list my ip but still it is not working.and btw what do you mean by using arrays rather than a normal object?
legendary
Activity: 2352
Merit: 1268
In Memory of Zepher
October 01, 2015, 06:31:39 AM
#4
I can't see any specific problem with your code, though I don't much understand why you are using associative arrays rather than a normal object. I cannot check the syntax of the URL right now, though will try to be sure that's correct when I get home.

What sort of an error do you get? A PHP error or an error returned in the JSON object from Blockchain?
full member
Activity: 182
Merit: 100
October 01, 2015, 12:11:24 AM
#3
Give us the code that you are using with sensitive info (Passwords, GUID) removed. I can try and fix it if so, or remake it for you.
Code:
$ID "";
$PW "";

$newAddy json_decode(file_get_contents("https://blockchain.info/merchant/$ID/NEW_address?password=$PW"), true);

$parseAddy $newAddy[address];

echo 
$parseAddy;

?>

this is the code i am using let me know where i am making mistake or please make one for me so i can research upon it and can resolve my problems
legendary
Activity: 2352
Merit: 1268
In Memory of Zepher
September 30, 2015, 07:23:49 PM
#2
Give us the code that you are using with sensitive info (Passwords, GUID) removed. I can try and fix it if so, or remake it for you.
full member
Activity: 182
Merit: 100
September 30, 2015, 07:07:23 PM
#1
hey friends i am trying to build a site with the bitcoin features and some of my friends suggested about the blockchain.info api to use it in the php. but after trying many things like watching tutorials from youtube or Following information from the blockchain site i am not able to make anything till now. please anyone show / make a new bitcoin address generating page so i can see where i am doing wrong or missing the peramiters or whatever mistakes i am doing
Jump to: