-
Notifications
You must be signed in to change notification settings - Fork 0
Notification module
Ben edited this page Apr 12, 2017
·
5 revisions
The notification module provides two type of notifications: address notifications and transaction notifications.
You can subscribe to the Address Subscription
and Transaction Subscription
by the following APIs to receive the Address Notification
and Transaction Notification
-
POST
/notification/v1/address/subscription -
GET
/notification/v1/address/subscription/[:subscription_id] -
POST
/notification/v1/address/subscription/[:subscription_id]/delete
-
POST
/notification/v1/tx/subscription -
GET
/notification/v1/tx/subscription/[:subscription_id] -
POST
/notification/v1/tx/subscription/[:subscription_id]/delete
Create an address subscription
Field | Type | Description |
---|---|---|
address | str | address |
callback_url | url | a webhook allows you to receive a notification |
{
"id": "c898943d-ac2e-42c8-afdc-a8f1a61d86a8",
"address": "1ABFCkDV6QUbin3PEiHBs3pPBZgs8kHzhB",
"callback_url": "http://example.com",
"created_time": "2016-08-17T07:42:12.489Z"
}
Get an address subscription
None
{
"id": "c898943d-ac2e-42c8-afdc-a8f1a61d86a8",
"address": "1ABFCkDV6QUbin3PEiHBs3pPBZgs8kHzhB",
"callback_url": "http://example.com",
"created_time": "2016-08-17T07:42:12.489Z"
}
Delete an address subscription
None
{
"deleted": true,
"id": "c898943d-ac2e-42c8-afdc-a8f1a61d86a8"
}
Create a transaction subscription
Field | Type | Description |
---|---|---|
tx_hash | str | transaction hash |
confirmation_count | int | confirmation threshold |
callback_url | url | a webhook allows you to receive a notification |
{
"id": "bd84e443-daa9-4000-a0ea-f162d273937a",
"tx_hash": "e6372839ab539785191f9fcdb19e015ad0e72143709f14e50dc5f6d069dd888f",
"confirmation_count": 3,
"callback_url": "http://example.com",
"created_time": "2016-08-17T07:49:41.706Z"
}
Get a transaction subscription
None
{
"id": "bd84e443-daa9-4000-a0ea-f162d273937a",
"tx_hash": "e6372839ab539785191f9fcdb19e015ad0e72143709f14e50dc5f6d069dd888f",
"confirmation_count": 3,
"callback_url": "http://example.com",
"created_time": "2016-08-17T07:49:41.706Z"
}
Delete a transaction subscription
None
{
"deleted": true,
"id": "bd84e443-daa9-4000-a0ea-f162d273937a"
}
POST
callback_url
When the address event that you subscribe happened. Your webhook will receive an address notification
{
"notification_id": "680aba58-3a86-4a07-b025-97d39830a397",
"subscription_id": "c898943d-ac2e-42c8-afdc-a8f1a61d86a8",
"tx_hash": "e6372839ab539785191f9fcdb19e015ad0e72143709f14e50dc5f6d069dd888f",
}
POST
callback_url
When the transaction event that you subscribe happened. Your webhooks will receive an transaction notification
{
"notification_id": "299f4f3f-71a7-4cb5-bb21-564e4c0f81bf",
"subscription_id": "bd84e443-daa9-4000-a0ea-f162d273937a",
"tx_hash": "e6372839ab539785191f9fcdb19e015ad0e72143709f14e50dc5f6d069dd888f",
}