Real-Time Notifications Block.io updates you in real-time when your wallet addresses' balances change for Bitcoin, Dogecoin, and Litecoin. This features opens up a vast variety of ways you can integrate digital currencies in your applications, and we can't wait to see how you use these notifications. We provide real-time notifications through Web Hooks, and Web Sockets: Through Web Hooks , we push data to you through HTTP Post requests to web servers of your choice.

, we push data to you through HTTP Post requests to web servers of your choice. Through Web Sockets, you subscribe to updates while staying connected to a Block.io Notifications server. The following document provides more details on each of these mechanisms.

Web Hooks You can start using Web Hooks by creating a Notification on your Block.io account below. Keep in mind, however, that since we are pushing data to you, we need a web server of yours to communicate with through POST requests. Some points of information regarding Web Hooks: All notifications (i.e., events that are not type=ping) will be issued using HTTP/S requests through n.block.io.

The source server (n.block.io) IP can change at any time.

Current list (updated Aug 3, 2020) of possible IP addresses for n.block.io is: 45.56.79.5

45.56.123.170

45.33.20.161

45.33.4.167

2600:3c00::f03c:91ff:fe33:2e14

2600:3c00::f03c:91ff:fe89:bb9b

2600:3c00::f03c:91ff:fe33:d082

2600:3c00::f03c:92ff:fe5e:4219

Your Web Server must respond with a Status Code of 2xx (i.e., between 200-299) for us to consider the notification successful.

respond with a Status Code of 2xx (i.e., between 200-299) for us to consider the notification successful. Unsuccessful notifications will be retried for ~24 hours with exponential back-off, after which your failing Web Hook will be disabled.

Web Hooks are available for Bitcoin, Dogecoin, Litecoin, and their Testnets.

All notification events will use JSON objects. A notification event will use the following structure: { "notification_id" : "...", // a unique identifier issued when you created the notification "delivery_attempt" : 1, // number of times we've tried deliverying this object "type" : "...", // the type of notification, helps you understand the data sent below "data" : { ... // the notification data }, "created_at" : 1426104819 // timestamp of when we created this notification } Create a Notification You can create a Web Hook notification for the following types of events: Account : Consists of balance changes for all your account's addresses for a given Network. Whenever an address' balance changes, this event is fired.

: Consists of balance changes for all your account's addresses for a given Network. Whenever an address' balance changes, this event is fired. Address : This event is fired when balance changes for a given address (internal or external).

: This event is fired when balance changes for a given address (internal or external). New-Blocks: Advanced. This event is fired whenever a new group of transactions is confirmed (i.e., a new block is mined). Furthermore, when you create a notification, you will specify a URL where we can perform POST requests. This URL will receive the following object, and must respond with a Status Code between 200-299. If successful, the notification will be created. { "type": "ping" } You can specify normal URLs guarded by parameters, or by a username/password (i.e., using Basic Auth), or just a simple URL without any parameters whatsoever. Securing this endpoint on your Web Server is completely up to you. Finally, create a notification using the following endpoints. If you encounter any issues, please make sure the URL is URI encoded so it is distinguishable as a parameter value. /api/v2/create_notification/?api_key=YOUR API KEY&type=account&url=YOUR URL /api/v2/create_notification/?api_key=YOUR API KEY&type=address&address=ANY ADDRESS&url=YOUR URL /api/v2/create_notification/?api_key=YOUR API KEY&type=new-blocks&url=YOUR URL If successful, you will receive a response with the following structure: { "status" : "success", "data" : { "network" : "BTC", "notification_id" : "306b6d...", "type" : "account", "enabled" : true, "url" : "..." } } 22e7c88c8604e45c Try now Hide Create a notification for balance changes for all your addresses API KEY: (Your API Keys are in your Wallet) URL: TYPE: Go! a254b4e3f116d874 Try now Hide Create a notification for balance changes for a specific address API KEY: (Your API Keys are in your Wallet) URL: TYPE: ADDRESS: Go! 0a2d89b24385253a Try now Hide Create a notification for new blocks API KEY: (Your API Keys are in your Wallet) URL: TYPE: Go! Disable a Notification You can disable a given notification at any time using the following action: /api/v2/disable_notification/?api_key=YOUR API KEY¬ification_id=NOTIFICATION ID e0f497934f3d0e6c Try now Hide Disable a given notification API KEY: (Your API Keys are in your Wallet) NOTIFICATION ID: Go! Enable a Notification You can enable a given notification at any time using the following action: /api/v2/enable_notification/?api_key=YOUR API KEY¬ification_id=NOTIFICATION ID 00bfe36899476967 Try now Hide Enable a given notification API KEY: (Your API Keys are in your Wallet) NOTIFICATION ID: Go! List Notifications You can list notifications for a given Network (specified by the API Key). These notifications can be enabled, or disabled. Upto 2500 notifications per page. Page parameter is optional. /api/v2/list_notifications/?api_key=YOUR API KEY&page=PAGE_NUMBER /api/v2/list_notifications/?api_key=YOUR API KEY¬ification_ids=NOTIFICATION_ID1,NOTIFICATION_ID2,...&page=PAGE_NUMBER ab79788d1194c7ef Try now Hide List all notifications API KEY: (Your API Keys are in your Wallet) PAGE: Go! 9ada9f478958281b Try now Hide Get a particular notification API KEY: (Your API Keys are in your Wallet) NOTIFICATION IDS: PAGE: Go! Get Recent Notification Events Produces a log of the last 10 notification events we pushed, or attempted to push, to your web server for a given Notification ID. /api/v2/get_recent_notification_events/?api_key=YOUR API KEY¬ification_id=NOTIFICATION ID 77312593f99ded20 Try now Hide Get the last 10 events for a Web Hook API KEY: (Your API Keys are in your Wallet) NOTIFICATION ID: Go! Delete Notification You can delete a given notification completely if you wish. /api/v2/delete_notification/?api_key=YOUR API KEY¬ification_id=NOTIFICATION ID efe4484a2b162f0a Try now Hide Delete a given notification API KEY: (Your API Keys are in your Wallet) NOTIFICATION ID: Go! Example Notifications For reference, here is the structure of each type of notification. Please note that Web Hooks of type account provide balance change notifications of type address. Balance Change Notification { "notification_id": "..." "delivery_attempt": 1, "created_at": 1426104819, "type": "address", "data": { "network": "BTC", "address": "3cBraN1Q...", "balance_change": "0.01000000", // net balance change, can be negative "amount_sent": "0.00000000", "amount_received": "0.01000000", "txid": "7af5cf9f2...", // the transaction's identifier (hash) "confirmations": X, // see below "is_green": false // legacy, can be ignored } } // X = {0,1,3} for Bitcoin, {0,1,10} for Dogecoin, {0,1,5} for Litecoin New Block Notification { "notification_id": "..." "delivery_attempt": 1, "created_at": 1426104819, "type": "new-blocks", "data": { "network": "BTC", "block_hash": "fb0e1...", // the block identifier (hash) "previous_block_hash": "5b217...", "block_no": 456485, // the block's height "confirmations": 1, // number of times this block has been confirmed // you will also receive an update at N confirmations: // N = 3 (Bitcoin), 10 (Dogecoin), 5 (Litecoin) "merkle_root": "8173983...", "time": 1426062467, "nonce": 1544718438, "difficulty": "0.01240701", "txs": [ // an array of txids "81739...", ... "ab123..." ] } }