Hi there,
I too noticed a few days ago that blockchains rpc api appeared to be not working correctly. It was because of this that I created a local VM and syncd the blockchain for local testing. I cannot say that my code would for sure work on blockchain.info, but IT DOES work on my local bitcoind.
To answer your question, per their documentation:
https://blockchain.info/api/json_rpc_apiyou DO need to authenticate:
Authentication
-rpcuser Should be set to your wallet identifier. This is a 36 character random string which can be found on your wallet login page.
-rpcpassword Should be set to your main wallet password. If double encryption is enabled your second password will need to be set using walletpassphrase
I ran three tests using the three different Uris you see in the below code snippet - Results after code. Its in powershell 4.0, in case your curious.
$cred = Get-Credential
#$Uri = "http://127.0.0.1:8332"
#$Uri = "http://rpc.blockchain.info:80"
$Uri = "https://rpc.blockchain.info:443"
$p_jsonrpc = "`"jsonrpc`":2.0"
$p_id = "`"id`":1"
function execute
{
param
(
$json
);
Write-Host "Connecting to $Uri"
$result = Invoke-WebRequest -Uri $Uri -Method Post -ContentType "application/json-rpc" -Credential $cred -Body $json
return $result.Content
}
function getInfo
{
$json =
@"
{"method":"getinfo",$p_id, $p_jsonrpc}
"@
Write-Host "Executing getinfo"
return execute($json)
}
getinfo
--------------POWERSHELL TRANSACTION-----------------
.\Powershell\bitcoin\bitcoinRPCtest.ps1
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Executing getinfo
Connecting to http://127.0.0.1:8332{"result":{"version":90100,"protocolversion":70002,"walletversion":60000,"balance":0.00000000,"blocks":79730,"timeoffset":-1,"connections":8,"proxy":"","difficulty":712.88486455,"testnet":fal
se,"keypoololdest":1402111629,"keypoolsize":101,"paytxfee":0.00000000,"errors":""},"error":null,"id":1}
.\Powershell\bitcoin\bitcoinRPCtest.ps1
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Executing getinfo
Connecting to http://rpc.blockchain.info:80{"error":{"message":"JSON-RPC method [getinfo] with 0 parameters not found.","code":-32601},"jsonrpc":"2.0"}
.\Powershell\bitcoin\bitcoinRPCtest.ps1
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Executing getinfo
Connecting to https://rpc.blockchain.info:443{"error":{"message":"JSON-RPC method [getinfo] with 0 parameters not found.","code":-32601},"jsonrpc":"2.0"}