# Block Height Information Retrieval API

## Get Block Height Information

<mark style="color:green;">`POST`</mark> `https://admin.ccpayment.com/ccpayment/v1/get/network/height/info`

#### Headers

| Name                                           | Type   | Description                                                                                                                                                         |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Sign<mark style="color:red;">\*</mark>         | string | SHA-256 (APPID + APP Secret +timestamp+<mark style="color:red;">**body (json string)**</mark>). [Signature guide](/ccpayment-v1.0-api/to-get-started/signature.md). |
| Timestamp<mark style="color:red;">\*</mark>    | string | Timestamp in seconds (10-digit). The request is valid for two minutes.                                                                                              |
| Appid<mark style="color:red;">\*</mark>        | string | Merchant's unique credential. Find it on the [Developer page](https://admin.ccpayment.com/developer/config)                                                         |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json; charset=utf-8                                                                                                                                     |

{% tabs %}
{% tab title="200: OK Success (200)/Fail (200)" %}
{% tabs %}
{% tab title="Success (200)" %}

#### **Response (Success 200)**

**Header**

**Body**

```json
{
  "code": 10000,
  "msg": "success",
  "data": [
    {
      "chain": "BCH",
      "current_chain_height": 803435,
      "tx_confirm_block_num": 2,
      "block_rate": 0
    },
    {
      "chain": "BSC",
      "current_chain_height": 30297917,
      "tx_confirm_block_num": 15
    }
    ...
  ]
}
```

**Parameters**
{% endtab %}

{% tab title="Fail (200)" %}

#### **Response (Fail 200)**

```json
{
	"code": 224066,
	"msg": "Service error, pleaser try again",
	"data": null
}
```

{% endtab %}

{% tab title="Remarks" %}
As a security measure, we will sign the returned data (and according to this only { code: 10000 } should be signed, but it's signing all the returned body.). Additionally, it will return Appid, Sign, Timestamp  in the header of the response.  The signature method SHA-256 (appid+appSecret+Timestamp+body).

Please use the data with caution if the signature verification fails. It indicates that the data has been tampered with.
{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

<table><thead><tr><th>Name</th><th>Value</th><th width="108" data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td>224066</td><td>true</td><td>Number</td><td></td></tr><tr><td>msg</td><td>Service error, please try again</td><td>true</td><td>String</td><td></td></tr><tr><td>data</td><td></td><td>true</td><td>Object</td><td></td></tr></tbody></table>

<table><thead><tr><th width="193">Name</th><th width="173">Value</th><th data-type="checkbox">Required </th><th>Type</th><th width="153">Description</th></tr></thead><tbody><tr><td>code</td><td>10000</td><td>true</td><td>integer</td><td></td></tr><tr><td>msg</td><td>Success</td><td>true</td><td>string</td><td></td></tr><tr><td>data</td><td></td><td>true</td><td>object</td><td></td></tr><tr><td>data.chain</td><td>BCH</td><td>true</td><td>string</td><td>The network's unique identification on the blockchain</td></tr><tr><td>data.current_chain_height</td><td>803435</td><td>true</td><td>int64</td><td>Current block height of the network</td></tr><tr><td>data.tx_confirm_block_num</td><td>2</td><td>true</td><td>int64</td><td>The number of block confirmations required for the trasnaction on the blockchain</td></tr><tr><td>data.block_rate</td><td>0</td><td>true</td><td>float64</td><td>The time gap of every blocks, in seconds</td></tr></tbody></table>

<table><thead><tr><th width="134">Name</th><th width="188">Value</th><th width="118">Required</th><th width="82">Type</th><th width="299">Description</th></tr></thead><tbody><tr><td>Appid</td><td>202302010636261620672405236006912</td><td>Y</td><td>String</td><td>Merchant's unique credential. Find it on the <a href="https://admin.ccpayment.com/developer/config">Developer page</a></td></tr><tr><td>Timestamp</td><td>1677152490</td><td>Y</td><td>String</td><td>Timestamp in seconds (10-digit). The request is valid for two minutes.</td></tr><tr><td>Sign</td><td>871f0223c66ea72435208d03603a0cb00b90f6ac4a4ba725d00164d967e291f6</td><td>Y</td><td>String</td><td>SHA-256(appId + appSecret + timestamp+<mark style="color:red;"><strong>body(json string)</strong></mark>)</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ccpayment.com/ccpayment-v1.0-api/resources-document/block-height-information-retrieval-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
