NAV
shell php javascript java csharp ruby python go

웹후크 APIs

콜백 요청

생성된 웹후크의 콜백에 요청을할때 전달되는 파라미터

Body Parameters

파라미터 타입 설명
webhook_id int 웹후크 고유 id
event string 발생한 이벤트 유형 (confirmed,unconfirmed)
address string 이벤트를 감지한 암호화폐 주소 입니다.
symbol string 이벤트가 발생한 자산 심볼
tx_hash string 이벤트가 발생한 거래 해쉬
api_token string md5로 암호화된 api_token

웹후크 생성

curl -X POST \
  https://api.blocksdk.com/v2/hooks \
  -H 'Content-Type: application/json' \
  -H 'X-API-Token: my-api-token' \
  -d '{
    "callback_url" : "https://blocksdk.com",
    "address" : "1LHkxNymfxadePvhg8pkjCqQzq1ktP2hZN",
    "symbol" : "btc"
    }'
$hook = $webhookClient->create([
    "callback_url" => "https://blocksdk.com",
    "symbol" => "btc",
    "address" => "1LHkxNymfxadePvhg8pkjCqQzq1ktP2hZN"
]);
var hook = webhookClient.create({
    "callback_url" : "https://blocksdk.com",
    "symbol" : "btc",
    "address" : "1LHkxNymfxadePvhg8pkjCqQzq1ktP2hZN"
})
hook = webhookClient.create({
    "callback_url" => "https://blocksdk.com",
    "symbol" => "btc",
    "address" => "1LHkxNymfxadePvhg8pkjCqQzq1ktP2hZN"
})
hook = webhookClient.create({
    "callback_url" : "https://blocksdk.com",
    "symbol" : "btc",
    "address" : "1LHkxNymfxadePvhg8pkjCqQzq1ktP2hZN"
})
hook := webhookClient.Create(map[string]interface{}{
    "callback_url" : "https://blocksdk.com",
    "symbol" : "btc",
    "address" : "1LHkxNymfxadePvhg8pkjCqQzq1ktP2hZN"
})

Response Body

{
    "payload": {
        "id": 2151,
        "symbol": "btc",
        "address": "1LHkxNymfxadePvhg8pkjCqQzq1ktP2hZN",
        "callback_url": "https://blocksdk.com"
    },
    "state": {
        "code": 201,
        "success": true
    }
}

정보

블록체인 이벤트 콜백을 받을 후크를 생성합니다.

HTTP Request

POST https://api.blocksdk.com/v2/hooks

Body Parameters

파라미터 타입 설명
callback_url* string 이벤트가 발생할때 호출될 콜백 URL 입니다.
symbol* string 암호화폐 심볼. (btc,bch,ltc,dash,eth,dash)
address* string 이벤트를 감지할 암호화폐 주소 입니다.

Response

변수 타입 설명
id int 웹후크 고유 id
symbol string 암호화폐 심볼
address string 이벤트를 감지할 암호화폐 주소 입니다.
callback_url string 이벤트 발생시 호출될 콜백 URL.

웹후크 목록

curl -X GET ' https://api.blocksdk.com/v2/hooks' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$webhooks = $webhookClient->getWebhooks([
    "offset" => 0,
    "limit" => 10
]);
var webhooks = webhookClient.getWebhooks({
    "offset" : 0,
    "limit" : 10
})
webhooks = webhookClient.getWebhooks({
    "offset" => 0,
    "limit" => 10
})
webhooks = webhookClient.getWebhooks({
    "offset" : 0,
    "limit" : 10
})
webhooks := webhookClient.GetWebhooks(map[string]interface{}{
    "offset" : 0,
    "limit" : 10
})

Response Body

{
    "payload": [
        {
            "id": 2151,
            "symbol": "btc",
            "address": "1LHkxNymfxadePvhg8pkjCqQzq1ktP2hZN",
            "callback_url": "https://blocksdk.com",
            "callback_error_count": 0,
            "datetime": "2021-01-12T02:31:16+00:00",
            "timestamp": 1610418676
        },

        ...

    ],
    "state": {
        "code": 200,
        "success": true
    }
}

정보

활성화된 웹후크 전체 목록을 가져옵니다.

HTTP Request

GET https://api.blocksdk.com/v2/hooks

Query Parameters

파라미터 타입 기본값 설명
offset int 0 주어진 기준에 대한 항목 목록 시작 위치의 순차 색인 번호
limit int 10 주어진 기준에 대한 항목 목록의 제한 수

Response

변수 타입 설명
id int 웹후크 고유 id
symbol string 암호화폐 심볼
address string 이벤트를 감지할 암호화폐 주소.
callback_url string 이벤트 발생시 호출될 콜백 URL.
callback_error_count int 콜백 호출 오류 횟수. 응답 코드가 200,201 외의 코드로 응답되었을경우 1식 증가합니다
datetime string 웹후크 생성 날짜,시간.
timestamp int 웹후크 생성 날짜,시간

콜백 응답 목록

curl -X GET 'https://api.blocksdk.com/v2/hooks/responses' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$responses = $webhookClient->getResponses([
    "offset" => 0,
    "limit" => 10
]);
var responses = webhookClient.getResponses({
    "offset" : 0,
    "limit" : 10
})
responses = webhookClient.getResponses({
    "offset" => 0,
    "limit" => 10
})
responses = webhookClient.getResponses({
    "offset" : 0,
    "limit" : 10
})
responses := webhookClient.GetResponses(map[string]interface{}{
    "offset" : 0,
    "limit" : 10
})

Response Body

{
    "payload": [
        {
            "webhook_id": 1325,
            "status_code": 200,
            "event": "confirmed",
            "tx_hash": "0x24343ea3244e016d830a2f953ef0b18269b5c715f2dcb99e6057b83ed025f85b",
            "datetime": "2020-12-16T06:41:53+00:00",
            "timestamp": 1608100913
        }

        ...

    ],
    "state": {
        "code": 200,
        "success": true
    }
}

정보

웹후크 콜백 호출 목록을 가져옵니다.

HTTP Request

GET https://api.blocksdk.com/v2/hooks/responses

Query Parameters

파라미터 타입 기본값 설명
offset int 0 주어진 기준에 대한 항목 목록 시작 위치의 순차 색인 번호
limit int 10 주어진 기준에 대한 항목 목록의 제한 수

Response

변수 타입 설명
webhook_id int 웹후크 고유 id
status_code string 콜백 응답 코드
event string 이벤트 이름
tx_hash string 이벤트가 발생한 거래 해쉬
datetime string 콜백 호출 날짜,시간
timestamp int 콜백 호출 날짜,시간

웹후크 가져오기

curl -X GET 'https://api.blocksdk.com/v2/hooks/2151' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$listWebHook = $webhookClient->get([
    "hook_id" => 2151
]);
var listWebHook = webhookClient.get({
    "hook_id" : 2151
})
listWebHook = webhookClient.get({
    "hook_id" => 2151
})
listWebHook = webhookClient.get({
    "hook_id" : 2151
})
listWebHook := webhookClient.Get(map[string]interface{}{
    "hook_id" : 2151
})

Response Body

{
    "payload": {
            "id": 2151,
            "symbol": "btc",
            "address": "1LHkxNymfxadePvhg8pkjCqQzq1ktP2hZN",
            "callback_url": "https://blocksdk.com",
            "callback_error_count": 0,
            "datetime": "2021-01-12T02:31:16+00:00",
            "timestamp": 1610418676
    }
    ,
    "state": {
        "code": 200,
        "success": true
    }
}

정보

특정 웹후크의 정보를 가져옵니다.

HTTP Request

GET https://api.blocksdk.com/v2/hooks/<hook_id>

URL Parameters

파라미터 타입 설명
hook_id* int 웹후크 id 입니다

Query Parameters

파라미터 타입 기본값 설명
offset int 0 주어진 기준에 대한 항목 목록 시작 위치의 순차 색인 번호
limit int 10 주어진 기준에 대한 항목 목록의 제한 수

Response

변수 타입 설명
id int 웹후크 고유 id
symbol string 암호화폐 심볼
address string 이벤트를 감지할 암호화폐 주소.
callback_url string 이벤트 발생시 호출될 콜백 URL.
callback_error_count int 콜백 호출 오류 횟수. 응답 코드가 200,201 외의 코드로 응답되었을경우 1식 증가합니다
datetime string 웹후크 생성 날짜,시간.
timestamp int 웹후크 생성 날짜,시간

특정 웹후크 콜백목록 가져오기

curl -X GET 'https://api.blocksdk.com/v2/hooks/1325/responses' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$responses = $webhookClient->getHookResponses([
    "hook_id" => 1325,
    "offset" => 0,
    "limit" => 10
]);
var responses = webhookClient.getHookResponses({
    "hook_id" : 1325,
    "offset" : 0,
    "limit" : 10
})
responses = webhookClient.getHookResponses({
    "hook_id" => 1325,
    "offset" => 0,
    "limit" => 10
})
responses = webhookClient.getHookResponses({
    "hook_id" : 1325,
    "offset" : 0,
    "limit" : 10
})
responses := webhookClient.GetHookResponses(map[string]interface{}{
    "hook_id" : 1325,
    "offset" : 0,
    "limit" : 10
})

Response Body

{
    "payload": [
        {
            "webhook_id": 1325,
            "status_code": 200,
            "event": "confirmed",
            "tx_hash": "0x24343ea3244e016d830a2f953ef0b18269b5c715f2dcb99e6057b83ed025f85b",
            "datetime": "2020-12-16T06:41:53+00:00",
            "timestamp": 1608100913
        }

        ...

    ],
    "state": {
        "code": 200,
        "success": true
    }
}

정보

특정 웹후크의 콜백 호출 목록을 가져옵니다.

HTTP Request

GET https://api.blocksdk.com/v2/hooks/<hook_id>/responses

URL Parameters

파라미터 타입 설명
hook_id* int 웹후크 id 입니다

Query Parameters

파라미터 타입 기본값 설명
offset int 0 주어진 기준에 대한 항목 목록 시작 위치의 순차 색인 번호
limit int 10 주어진 기준에 대한 항목 목록의 제한 수

Response

변수 타입 설명
webhook_id int 웹후크 고유 id
status_code string 콜백 응답 코드
event string 이벤트 이름
tx_hash string 이벤트가 발생한 거래 해쉬
datetime string 콜백 호출 날짜,시간
timestamp int 콜백 호출 날짜,시간

웹후크 삭제

curl -X DELETE 'https://api.blocksdk.com/v2/hooks/2151' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$hook = $webhookClient->delete([
    "hook_id" => 2151
]);
var hook = webhookClient.delete({
    "hook_id" : 2151
})
hook = webhookClient.delete({
    "hook_id" => 2151
})
hook = webhookClient.delete({
    "hook_id" : 2151
})
hook := webhookClient.Delete(map[string]interface{}{
    "hook_id" : 2151
})

Response Body

{
    "payload": {
        "id": 2151
    },
    "state": {
        "code": 201,
        "success": true
    }
}

정보

활성화된 웹후크를 삭제합니다.

HTTP Request

DELETE https://api.blocksdk.com/v2/hooks/<hook_id>

URL Parameters

파라미터 타입 설명
hook_id* int 웹후크 id 입니다

Response

변수 타입 설명
id int 삭제된 웹후크 고유 id