BlockSDK REST API
  • Introduction
  • Bitcoin
  • BitcoinCash
  • Ethereum
    • ERC20 TOKEN
  • Litecoin
  • Monero
  • Dash
  • WebHook
  • Usage
  • Go To BLOCKSDK
Powered by GitBook
On this page
  • Create WebHook Client
  • Object
  • WebHook
  • WebHookResponse
  • CallbackRequest
  • ListHook
  • Response
  • CreateHook
  • DeleteHook
  • ListHookResponse
  • Response
  • GetHook
  • Response
  • GetHookResponse
  • Response

Was this helpful?

WebHook

Create WebHook Client

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

category

string

Cryptocurrency symbol

address

string

Cryptocurrency address

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

ListHook

GET https://api.blocksdk.com/v1/hook

Query Parameters

Name
Type
Description

offset

number

WebHook List Offset

limit

number

Number of WebHook to import

[
    {
        "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

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

CreateHook

POST https://api.blocksdk.com/v1/hook

Headers

Name
Type
Description

x-api-key

string

API authentication key

Request Body

Name
Type
Description

callback

string

Callback address to call when event occurs

category

string

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

address

string

Cryptocurrency Address

[]
$hook = $webhookClient->create([
    "callback" => "https://test.com/callback",
    "category" => "btc",
    "address" => "18Crf5jR5P9vryyjqPWJh1TZDTGXajcUgr"
]);

DeleteHook

POST https://api.blocksdk.com/v1/hook/{hook_id}/delete

Path Parameters

Name
Type
Description

hook_id

string

aWeb Hook Unique ID

[]
$hook = $webhookClient->delete([
    "hook_id" => 1
]);

ListHookResponse

GET https://api.blocksdk.com/v1/hook/response

Query Parameters

Name
Type
Description

offset

number

WebHookResponse List Offset

limit

number

Number of WebHookResponse to import

{
    "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

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

GetHook

GET https://api.blocksdk.com/v1/hook/{hook_id}

{
        "id":9,
        "category":"btc",
        "address":"17AJUKEaJPhrqSRwZtr3usw9Na6f8SHMqG",
        "callback":"https:\/\/test.com\/callback",
        "callback_error":0,
        "created_at":"2019-09-13 10:20:23"
}

Response

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

GetHookResponse

GET https://api.blocksdk.com/v1/hook/{hook_id}/response

Query Parameters

Name
Type
Description

offset

number

WebHookResponse List Offset

limit

number

Number of WebHookResponse to import

{
    "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

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

Last updated 4 years ago

Was this helpful?

Object

Object

Object

Object

webhook
WebHookResponse
WebHook
WebHookResponse