Although I am not yet fully happy with it the API is now online
. I will certainly add some more stuff (oAuth authentication, better response/error messages, ...) but the general idea will stay like it is now.
The API follows the REST scheme, which means you can create, read, update and delete your agents and notification settings with standard http POST/GET/PUT/DELETE operations.
Currently only basic authentication is in place, so you have to provide user and password with each request, which of course is quite inconvinient... Next thing to add is oAuth token-based authentication.
Note: Be sure to always include the trailing slash in any url!
Get information about all your agents:Browser:
http://www.bitcoinmonitor.net/api/v1/agents/Commandline using curl:
curl -i -u
: http://www.bitcoinmonitor.net/api/v1/agents/ Create a new agent:You need to provide only 2 parameters:
- name: The agents name
- watch_type: "1" for notification on withdrawal, "2" for notificatoin on deposits, "3" for both notifications
- addresses: (optional) list of addresses to watch, seperated by comma
curl -i -u
: -X POST -d "name=new_agent&watch_type=2" http://www.bitcoinmonitor.net/api/v1/agents/ Change an existing agent:You need to know the ID of the agent (get it from the agent list). You can set:
- name: The agents name
- watch_type: "1" for notification on withdrawal, "2" for notificatoin on deposits, "3" for both notifications
- addresses: list of addresses to watch, seperated by comma
curl -i -u
: -X PUT -d "addresses=" http://www.bitcoinmonitor.net/api/v1/agent// Delete an existing agent:You need to know the ID of the agent (get it from the agent list).
curl -i -u
: -X DELETE http://www.bitcoinmonitor.net/api/v1/agent// Get notification settings for an agent:You need to know the ID of the agent you want to work with (get it from the agent list). You need to provide the notification type you want to access:
curl -i -u
: http://www.bitcoinmonitor.net/api/v1/agent//notification// Create new notification setting:You need to know the ID of the agent you want to work with (get it from the agent list). Required parameters:
- req_confirmations: Confirmations required, 0 to 10
- email: email (required for type "email")
curl -i -u
: -X POST -d "req_confirmations=0" http://www.bitcoinmonitor.net/api/v1/agent//notification/feed/curl -i -u
: -X POST -d "[email protected]" http://www.bitcoinmonitor.net/api/v1/agent//notification/email/curl -i -u
: -X POST -d "req_confirmations=0&url=http://my.shop.com/payment_confirmation/" http://www.bitcoinmonitor.net/api/v1/agent//notification/url/ List bitcoinaddresses watched by agent:You need to know the ID of the agent you want to work with (get it from the agent list)
curl -i -u
: http://www.bitcoinmonitor.net/api/v1/agents//address/ Add a bitcoinaddress to an agent:You need to provide 1 parameters:
- address: address to watch
curl -i -u
: -X POST -d "address=" http://www.bitcoinmonitor.net/api/v1/agent//address/ Remove a bitcoinaddress from an agent:No parameters as address is the ressource and part of url:
curl -i -u
: -X DELETE http://www.bitcoinmonitor.net/api/v1/agent//address/The agent_ID is guaranteed to never change once an agent is created. So if you have an agent set up it is safe to hardcode its ID in your code.
As all this is still not matured I will not add API documentation to the site itself. As soon as i got some user feedback and added the missing stuff I will also extend the documentation.