5.4.4.10 Get DApp Block Height API
This interface is used to get block height in a DApp.
1. Interface address:
https://PCNGatewayAddress/api/fiscobcos/v1/node/getBlockHeight
2. Call Method: POST
3. Signature algorithm: required and refer to Section 5.4.4.1
4. Call parameters
No. | Field name | Field | Type | Required | Remarks |
---|---|---|---|---|---|
1 | Header | header | Map | Y | |
2 | Body | body | Map | Y | |
3 | Signature Value | mac | String | Y | |
header | |||||
1 | user unique ID | userCode | String | Y | |
2 | DApp unique ID | appCode | String | Y |
Example:
{"header":{"appCode":"cl0006202003181926573677572","userCode":"USER0006202003181951281835816"},"body":{},"mac":"MEQCIHb2o7hb0apDukOQBXkZftETsizDBaftnHxO9A9ux5EtAiABuiFrVYPWT5FiU+Wd9HpXF/AJh0Yh2SXtL6h98m4eZw=="}
5. Response parameters
No. | Field name | Field | Type | Required | Remarks |
---|---|---|---|---|---|
1 | Header | header | Map | Y | |
2 | Body | body | Map | Y | |
3 | Signature Value | mac | String | Y | |
header | |||||
1 | Response ID | code | int | Y | 0: authentication successful -1: authentication failed |
2 | Response message | msg | String | N | if code=0 then can be null |
Body | |||||
1 | Block Height | data | string | N | If code not 0, then leave blank |
Example:
{
"header": {
"code": 0,
"msg": "Transaction Successful"
},
"mac": "MEQCICtCOdv4ZL72M3WoA9nAei2P0/PpKjlgI0Y5qeuzg61uAiA9D3TcB/+b2RMuNwVq+X0vgiglHfM5NBhoTJPR0gCPMA==",
"body": {
"data": "4"
}
}