Create a new instance of WebHook object
{
"event":"unconfirmed-tx",
"url":"https://requestb.in/slmm49sl",
}
Fill up the basic information that is required for the webhook The URL should be actually accessible over the internet. Having a localhost here would not work.
The transaction or block associated with the event you subscribed to will be POSTed to the provided URL. The POST request will also include a X-EventType and a X-EventId HTTP header specifying the type of and id of the webhook which triggered the request. X-Eventtype: unconfirmed-tx X-Eventid: f1cef7d6-cfd9-459c-8ebc-42226ae2b1a7
Event types correspond to what kind of notifications you want to receive on the given URL. Complete event list: http://dev.blockcypher.com/#events
For Sample Purposes Only.
Create WebHook Sample
This sample code demonstrate how you can create a webhook, as documented here at: http://dev.blockcypher.com/#webhooks API used: POST /v1/btc/main/hooks