WebHook

Create WebHook Client

PHP
PHP
use BlockSDK;
$blockSDK = new BlockSDK("YOU_TOKEN");
$webhookClient = $blockSDK->createWebHOOK();
or
$webhookClient = BlockSDK::createWebHook("YOU_TOKEN");

Object

WebHook

Name

Type

Content

id

int

WebHook Unique Number

category

string

Cryptocurrency Address Types(btc,bch,ltc,dash,eth,xmr)

address

string

Cryptocurrency Address

callaback

string

Address to request when event occurs (http, https)

callback_error

int

Callback Address Call Error Count

create_at

datetime

Webhook creation datetime

WebHookResponse

Name

Type

Content

webhook_id

int

WebHook Unique Number

status

int

Callback Address Call Response Code

event

string

Trading event(confirmed,unconfirmed)

tx_hash

string

Transaction hash

datetime

datetime

Event Date Time

CallbackRequest

Name

Type

Content

webhook_id

int

ID issued when creating web hook

event

string

Event type (confirmed or unconfirmed)

category

string

Coin Type (btc or bch or ltc or eth or dash or xmr)

address

string

Cryptocurrency address where the event occurred

tx_hash

string

Transaction hash

api_token

string

User's api token

get
ListHook

https://api.blocksdk.com/v1/hook
Request
Response
Request
Headers
x-api-key
required
string
API authentication key
Query Parameters
offset
optional
number
WebHook List Offset
limit
optional
number
Number of WebHook to import
Response
200: OK
[
{
"id":9,
"category":"btc",
"address":"17AJUKEaJPhrqSRwZtr3usw9Na6f8SHMqG",
"callback":"https:\/\/test.com\/callback",
"callback_error":0,
"created_at":"2019-09-13 10:20:23"
},
{
"id":11,
"category":"btc",
"address":"18Crf5jR5P9vryyjqPWJh1TZDTGXajcUgr",
"callback":"https:\/\/test.com\/callback",
"callback_error":0,
"created_at":"2019-09-16 02:52:28"
}
]

Response

Object webhook

PHP
PHP
$listWebHook = $webhookClient->list([
"offset" => 0,
"limit" => 10
]);

post
CreateHook

https://api.blocksdk.com/v1/hook
Request
Response
Request
Headers
x-api-key
required
string
API authentication key
Body Parameters
callback
required
string
Callback address to call when event occurs
category
required
string
Cryptocurrency Types(btc,bch,ltc,dash,eth,xmr)
address
required
string
Cryptocurrency Address
Response
201: Created
[]
PHP
PHP
$hook = $webhookClient->create([
"callback" => "https://test.com/callback",
"category" => "btc",
"address" => "18Crf5jR5P9vryyjqPWJh1TZDTGXajcUgr"
]);

post
DeleteHook

https://api.blocksdk.com/v1/hook/{hook_id}/delete
Request
Response
Request
Path Parameters
hook_id
required
string
aWeb Hook Unique ID
Headers
x-api-key
required
string
API athentication key
Response
201: Created
[]
PHP
PHP
$hook = $webhookClient->delete([
"hook_id" => 1
]);

get
ListHookResponse

https://api.blocksdk.com/v1/hook/response
Request
Response
Request
Headers
x-api-key
required
string
API authentication key
Query Parameters
offset
optional
number
WebHookResponse List Offset
limit
optional
number
Number of WebHookResponse to import
Response
200: OK
{
"webhook_response":[
{
"webhook_id":1,
"status":404,
"event":"confirmed",
"tx_hash":"892235a5aa0f52c2240603e9ca55012f0c76fee688623961003eae1f0ede4506",
"datetime":"2019-12-15T18:42:15.000000Z"
},
{
"webhook_id":1,
"status":404,
"event":"unconfirmed",
"tx_hash":"892235a5aa0f52c2240603e9ca55012f0c76fee688623961003eae1f0ede4506",
"datetime":"2019-12-15T02:38:00.000000Z"
}
]
}

Response

Object WebHookResponse

PHP
PHP
$listWebHook = $webhookClient->listResponse([
"offset" => 0,
"limit" => 10
]);

get
GetHook

https://api.blocksdk.com/v1/hook/{hook_id}
Request
Response
Request
Headers
x-api-key
required
string
API authentication key
Response
200: OK
{
"id":9,
"category":"btc",
"address":"17AJUKEaJPhrqSRwZtr3usw9Na6f8SHMqG",
"callback":"https:\/\/test.com\/callback",
"callback_error":0,
"created_at":"2019-09-13 10:20:23"
}

Response

Object WebHook

PHP
PHP
$listWebHook = $webhookClient->get([
"hook_id" => 9
]);

get
GetHookResponse

https://api.blocksdk.com/v1/hook/{hook_id}/response
Request
Response
Request
Headers
x-api-key
required
string
API authentication key
Query Parameters
offset
optional
number
WebHookResponse List Offset
limit
optional
number
Number of WebHookResponse to import
Response
200: OK
{
"webhook_response":[
{
"webhook_id":1,
"status":404,
"event":"confirmed",
"tx_hash":"892235a5aa0f52c2240603e9ca55012f0c76fee688623961003eae1f0ede4506",
"datetime":"2019-12-15T18:42:15.000000Z"
},
{
"webhook_id":1,
"status":404,
"event":"unconfirmed",
"tx_hash":"892235a5aa0f52c2240603e9ca55012f0c76fee688623961003eae1f0ede4506",
"datetime":"2019-12-15T02:38:00.000000Z"
}
]
}

Response

Object WebHookResponse

PHP
PHP
$listWebHook = $webhookClient->getResponse([
"hook_id" => 1,
"offset" => 0,
"limit" => 10
]);