Author

Topic: bitcoinmonitor.net API 401 error (Read 1734 times)

newbie
Activity: 46
Merit: 0
May 16, 2013, 05:07:12 PM
#12
the command line works for me; I was able to insert an address


fairly confident the php script is missing something, its not replicating the command line correctly somewhere
newbie
Activity: 8
Merit: 0
May 16, 2013, 05:02:30 PM
#11
Bitcoinmonitor's API structure is eerily similar to Coinbase.com - I know for a fact that Coinbase.com's API was giving HTTP 401 error codes last night and today.  This has got to be related to coinbase's issues
newbie
Activity: 46
Merit: 0
May 16, 2013, 04:59:21 PM
#10
getting closer


Code:


                $url 'http://www.bitcoinmonitor.net/api/v1/agent/749/address/';
     
    
$curlHandle curl_init($url);
    
curl_setopt($curlHandleCURLOPT_HTTPHEADER, array('Authorization: *****'));
    
curl_setopt($chCURLOPT_POST1);
    
curl_setopt($chCURLOPT_POSTFIELDS,
                
"address=1DBDaYNhLMzmK1vdetGg45BgydXqRtGMRy");
     
    
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
     
    
$execResult curl_exec($curlHandle);
     
    
?>




still not working :/

this command line works; just trying to replicate it

curl -H "Authorization: " http://www.bitcoinmonitor.net/api/v1/agent/17/address/ -X POST -d"address=1BTC1oo1J3MEt5SFj74ZBcF2Mk97Aah4ac"
newbie
Activity: 46
Merit: 0
May 16, 2013, 04:39:09 PM
#9
btc sent

curl_setopt($curlHandle, CURLOPT_PUT, 1);

error out

411 Length required


unless I do this,
curl_setopt($curlHandle, CURLOPT_PUT, true, 1);

but im not ever sure why ? it dumps the info without that line?

ive been tinkering with this so far


Code:

$url 'http://www.bitcoinmonitor.net/api/v1/agent/749/address/';

$curlHandle curl_init($url);
curl_setopt($curlHandleCURLOPT_HTTPHEADER, array('Authorization: f5a2d40496ab9375f2c7436ac9d346806c179ecd'));
curl_setopt($curlHandleCURLOPT_PUTtrue1);
curl_setopt($chCURLOPT_POSTtrue'1DBDaYNhLMzmK1vdetGg45BgydXqRtGMRx');
$execResult curl_exec($curlHandle);
?>



but Im still not able to POST the address to add it to the api? :/
member
Activity: 101
Merit: 10
May 16, 2013, 03:31:00 PM
#8
Added an address in my signature.

$url = 'http://www.bitcoinmonitor.net/api/v1/agent//address/';

$curlHandle = curl_init($url);
curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array('Authorization: ***'));
curl_setopt($curlHandle, CURLOPT_PUT, 1);

$execResult = curl_exec($curlHandle);

Here's an untested example, but should get you started.
newbie
Activity: 46
Merit: 0
May 16, 2013, 03:20:26 PM
#7
Got it to dump my agent info

http://pastebin.com/pB3z23Um


were right the header wasn't getting called correctly, linked helped.



trying to wrap my head around the POST

POST    

Add a bitcoin address to the agent's watchlist.
     
curl example:    curl -H "Authorization: " http://www.bitcoinmonitor.net/api/v1/agent/17/address/ -X POST -d"address=1BTC1oo1J3MEt5SFj74ZBcF2Mk97Aah4ac"


not sure how that would look like in the php


btw, you can dump your address for bounty. this fixed my frustrations Smiley
member
Activity: 101
Merit: 10
May 16, 2013, 02:55:34 PM
#6
Works for me, make sure you don't put your api-key inside the <****> instead should just be ****

Also create your agent inside the dashboard... <-- id number location

curl -H "Authorization: xxx" http://www.bitcoinmonitor.net/api/v1/agent/
[
    {
        "addresses": [
            {
                "address": "xxx"
            }
        ],
        "watch_type": 2,
        "id": xxx,
        "feednotification_set": [],
        "urlnotification_set": [],
        "xmppnotification_set": [],
        "emailnotification_set": [],
        "name": "xxx"
    }
]
newbie
Activity: 46
Merit: 0
May 16, 2013, 02:34:15 PM
#5
First im trying to dump my agents to find out my agent_id

"
Retrieve a list of all agents.
    http://www.bitcoinmonitor.net/api/v1/agent/
"

For the life of me i cant find the id number on the website. But I shouldnt need it for this call



curl -H "Authorization: <*********************>" http://www.bitcoinmonitor.net/api/v1/agent/

Authorization Required

is giving me this error, just that, a bit different then the long 401 error
member
Activity: 101
Merit: 10
May 16, 2013, 02:25:22 PM
#4
Also are you including your agent id in the curl url.

http://www.bitcoinmonitor.net/api/v1/agent/$agentid/address/
member
Activity: 101
Merit: 10
May 16, 2013, 02:12:33 PM
#3
1. Open Terminal and verify the agent is configured correctly

curl -H "Authorization: " http://www.bitcoinmonitor.net/api/v1/agent/$agentid/

2. It doesn't look like you are formatting your header correctly.

Please check this documentation
http://www.php.net/manual/en/function.curl-setopt.php
newbie
Activity: 46
Merit: 0
May 16, 2013, 02:00:04 PM
#2
*bump added bounty
newbie
Activity: 46
Merit: 0
May 16, 2013, 01:45:04 PM
#1
getting the following error

HTTP/1.1 401 UNAUTHORIZED Server: nginx/0.7.67 Date: Thu, 16 May 2013 17:40:10 GMT Content-Type: text/html; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Vary: Authorization Authorization Required1


my script:
http://pastebin.com/pB3z23Um


I tried making new keys, and tried "Authorization: " to no avail

(*edit)advice that gets me working, or posts a working script ill send .1btc
Jump to: