# General Web API
Operations in this section do not require authentication.
# Get Node Information
Returns the node's information
# Request
- Method: GET
- URL: /getinfo
- Query parameters in URL: None
# Response
- Success:
- Code: 200
- Return value:
{ "value": { "status": "Current status reported by the node", "height": "Current block height of the node", "mempoolSize": "Number of entries in the memory pool", "identity": "The nodes address", "role": "Core/Observer/application node", "extensions": "Modules loaded" }, "atHeight": "Current block's height when requested" }
# Get Tables
Returns a list of table descriptors of the existing tables. Tables will return different information fields, like permissions, according to their definition.
# Request
- Method: GET
- URL: /tables
- Query parameters in URL: None
# Response
- Success
- Code: 200
- Return value:
{ "value": [ { "name": "Name of table", "tracked": "Option for tracking the history of the table", "supportProofs": "Option for track the proof of each change on that table" } ], "atHeight": "Current block's height when requested" }
# Get Current Height
Returns the height of the blockchain stored by the node.
# Request
- Method: GET
- URL: /height
- Query Parameters in URL: None
# Response
- Success
- Code: 200
- Return value:
{ "value": "Current block height of the node", "atHeight": "Current block's height when requested" }
# Get Blocks with Height and Depth
Returns the information from a given set of blocks, which are arranged in decreasing order according to its height.
# Request
- Method: GET
- URL: /blocks
- Query Parameters in URL: Start Height, Depth
# Response
Success
- Code: 200
- Return value:
{ "value": [ { "Height": "Block height", "Id": "Block ID", "txCount": "The number of transactions in the block", "sizeBytes": "The size of this block", "Body": "The block body of this block", "header": "The header of this block", "evidence": "The signatures of this block from consensus nodes" } ], "atHeight": "Current block's height when requested" }
Validation Error
- Code: 400
- Reason:
- Start Height or Depth is negative
- Depth is larger than maxBlockDepth
Object Not Found
- Code: 404
- Reason:
- Start Height is larger than current height
# Get Block with Block ID
Returns the block information from a given block id.
# Request
- Method: GET
- URL: /block/id/{id}
- Query parameters in URL: None
# Response
Success
- Code: 200
- Return value:
{ "value": { "Height": "Block height", "Id": "Block ID", "txCount": "The number of transactions in the block", "sizeBytes": "The size of this block", "Body": "The block body of this block", "header": "The header of this block", "evidence": "The signatures of this block from consensus nodes" }, "atHeight": "Current block's height of the request" }
Object Not Found
- Code: 404
- Reason:
- Block does not exist
Validation Error
- Code: 400
- Reason:
- ID is not a Byte string
# Get Block with Height
Returns the block information from a given height.
# Request
- Method: GET
- URL: /block/height/{height}
- Query parameters in URL: None
# Response
Success
- Code: 200
- Return value:
{ "value": { "Height": "Block height", "Id": "Block ID", "txCount": "The number of transactions in the block", "sizeBytes": "The size of this block", "Body": "The block body of this block", "header": "The header of this block", "evidence": "The signatures of this block from consensus nodes" }, "atHeight": "Current block's height when requested" }
Object Not Found
- Code: 404
- Reason:
- Block does not exist
Validation Error
- Code: 400
- Reason:
- Height is not an integer
# Get Block Headers with Height and Depth
Returns the header and consensus evidence from a given set of blocks, which is arranged in decreasing order according to its block height.
# Request
- Method: GET
- URL: /headers
- Query parameters in URL: Start Height, Depth
# Response
Success
- Code: 200
- Return value:
{ "value": [ { "Height": "Block height", "Id": "Block ID", "header": "The header of this block", "evidence": "The signatures of this block from consensus nodes" } ], "atHeight": "Current block's height when requested" }
Validation Error
- Code: 400
- Reason:
- Start Height or Depth is negative
- Depth is larger than maxBlockDepth
Object Not Found
- Code: 404
- Reason:
- Start Height is larger than current height
# Get Header with Block ID
Returns the block header and consensus evidence from a given block id.
# Request
- Method: GET
- URL: /headers/id/{id}
- Query parameters in URL: None
# Response
Success
Code: 200
Return value:
{ "value": { "Height": "Block height", "Id": "Block ID", "header": "The header of this block", "evidence": "The signatures of this block from consensus nodes" }, "atHeight": "Current block's height when requested" }
Object Not Found
- Code: 404
- Reason:
- Block does not exist
Validation Error
- Code: 400
- Reason:
- ID is not a Byte string
# Get Header with Height
Returns the block header and consensus evidence from a given height.
# Request
- Method: GET
- URL: /headers/height/{height}
- Query parameters in URL: None
# Response
Success
- Code: 200
- Return value:
{ "value": { "Height": "Block height", "Id": "Block ID", "header": "The header of this block", "evidence": "The signatures of this block from consensus nodes" }, "atHeight": "Current block's height when requested" }
Object Not Found
- Code: 404
- Reason:
- Block does not exist
Validation Error
- Code: 400
- Reason:
- Height is not an integer
# Get Block Events with Block ID
Returns the block events from a given block id.
# Request
- Method: GET
- URL: /blockevents/id/{id}
- Query parameters in URL: None
# Response
Success
Code: 200
Return value:
{ "value": { "Id": "Block ID", "TransactionEventsInfo": [ { "TxIndex": "Index used for managing transaction for events", "TxId": "Transaction ID", "TriggeredEvent": "List of triggered events including data", "FilterData": "Bloom filter of events for quick search" } ] }, "atHeight": "Current block's height when requested" }
Object Not Found
- Code: 404
- Reason:
- Block or events does not exist
Validation Error
- Code: 400
- Reason:
- ID is not a Byte string
# Get Block Events with Height
Returns the events for the block at given height.
# Request
- Method: GET
- URL: /blockevents/height/{height}
- Query parameters in URL: None
# Response
Success
- Code: 200
- Return value:
{ "value": { "Id": "Block ID", "TransactionEventsInfo": [ { "TxIndex": "Index used for managing transactions for events", "TxId": "Transaction ID", "TriggeredEvent": "List of triggered events including data", "FilterData": "Bloom filter of events for quick search" } ] }, "atHeight": "Current block's height when requested" }
Object Not Found
- Code: 404
- Reason:
- Block or events does not exist
Validation Error
- Code: 400
- Reason:
- Height is not an integer
# Get Peers count
Returns the number of peers the node is currently connected to.
# Request
- Method: GET
- URL: /peercount
- Query Parameters in URL: None
# Response
Success
Code: 200
Return value:
{ "value": "The number of peers the node is currently connected to", "atHeight": "Current block's height when requested" }
# Get Peers
Returns the list of public keys of the peers the node is currently connected to. This list does not include the one from the queried node.
# Request
- Method: GET
- URL: /peers
- Query Parameters in URL: None
# Response
- Success
- Code: 200
- Return value:
{ "value": "The pubic keys of peers the node is currently connected to", "atHeight": "Current block's height when requested" }
# Get Transaction Info By Id
Returns the transaction information from a given transaction Id.
# Request
- Method: GET
- URL: /tx/{id}
- Query Parameters in URL: None
# Response
Success
Code: 200
Return value:
{ "value": { "Transaction": "The original transaction", "TransactionPointer": { "Height": "The block height of the transaction if committed", "txIndex": "The transaction index within the block" }, "Result": "Transaction Result Code" }, "atHeight": "Current block's height when requested" }
Object Not Found
- Code: 404
- Reason:
- Transaction does not exist in the memory pool or any block
Validation Error
- Code: 400
- Reason:
- ID is not a valid byte string
# Get Transaction Infos By Ids
Returns the transaction information from a given list of transaction Ids.
# Request
- Method: POST
- URL: /txs
- Query Parameters in URL: None
- Body:
[ transactionId1, transactionId2 ]
# Response
Success
- Code: 200
- Return value:
{ "value": [ { "Transaction": "The original transaction", "TransactionPointer": { "Height": "The block height of the transaction if committed", "txIndex": "The transaction index within the block" }, "Result": "Transaction Result Code" } ], "atHeight": "Current block's height when requested" }
Object Not Found
- Code: 404
- Reason:
- Transaction does not exist in any block (Note: For multiple transactions, the transaction id is not looked up in the mempool to avoid performance issues)
Validation Error
- Code: 400
- Reason:
- ID is not a valid byte string
# Get Transaction Result By Id
Returns the result of a previously submitted transaction from a given transaction Id.
# Request
- Method: GET
- URL: /tx/result/{id}
- Query Parameters in URL: None
# Response
Success
- Code: 200
- Return value:
{ "value": { "Result Code": "The result code of the transaction", "Error Message": "Exception information if the transaction failed." }, "atHeight": "Current block's height when requested" }
Object Not Found
- Code: 404
- Reason:
- Transaction does not exist in memory pool and blocks
Validation Error
- Code: 400
- Reason:
- ID is not a valid byte string
# Get Transaction Results By IDs
Returns the result of previously submitted transactions from a given transaction ID list.
# Request
- Method: POST
- URL: /txresults
- Query Parameters in URL: None
- Body:
{ "transactionResultsRequest": [transactionId] }
# Response
Success
- Code: 200
- Return value:
{ "value": [ "<Result Code>" // the result code of each specified transactions ], "atHeight": "Current block's height when requested" }
Validation Error
- Code: 400
- Reason:
- ID is not a valid byte string
# Get Transaction List By Height
Returns a set of transactions contained in the block of the specific height.
# Request
- Method: GET
- URL: txlist/{height}
- Query Parameters in URL: None
# Response
Success
- Code: 200
- Return value:
{ "value": [ { "Transaction": "The original transaction", "TransactionPointer": { "Height": "The block height of the transaction if committed", "txIndex": "The transaction index within the block" }, "Result": "Transaction Result Code" } ], "atHeight": "Current block's height when requested" }
Object Not Found
- Code: 404
- Reason:
- Block does not exist
Validation Error
- Code: 400
- Reason:
- Height is not a valid byte string
# Get Performance of Node
Returns the performance information of the node.
# Request
- Method: GET
- URL: /performace
- Query Parameters in URL: None
# Response
Success
Code: 200
Return value:
{ "value": { "StatsStartHeight": "The height at which the statistics computation has started.", "TxPerBlock": "A value set for transactions", "TransactionsPerSecond": "A value set for transactions per second.", "BlockConfirmationTime": "A value set for block confirmation time." }, "atHeight": "Current block's height when requested" }
# Get History of Row
Returns a list containing the transaction history from a given key and table.
# Request
- Method: GET
- URL: history/{tableName}/{key}
- Query Parameters in URL: None
# Response
Success
Code: 200
Return value:
{ "value": [ "<txId>" // ID of transactions that modified this entry ], "atHeight": "Current block's height when requested" }
Object Not Found
- Code: 404
- Reason:
- Transaction history does not exist.
Validation Error
- Code: 400
- Reason:
- Key is not a valid byte string
# Get History detail of Row
Returns a list containing a detailed history from a given key and table.
# Request
- Method: GET
- URL: history/{tableName}/{key}/detail
- Query Parameters in URL: None
# Response
Success
- Code: 200
- Return value:
{ "value": [ { "Transaction": "The original transaction", "TransactionPointer": { "Height": "The block height of the transaction if committed", "txIndex": "The transaction index within the block" }, "Result": "Transaction Result Code" } ], "atHeight": "Current block's height when requested" }
Object Not Found
- Code: 404
- Reason:
- Transaction history does not exist.
Validation Error
- Code: 400
- Reason:
- Key is not a valid byte string
# Get Memory Pool Count
Returns the number of transactions currently stored in the memory pool of the node.
# Request
- Method: GET
- URL: /mempool/count
- Query Parameters in URL: None
# Response
- Success
- Code: 200
- Return value:
{ "value": "The amount of transactions in memory pool", "atHeight": "Current block's height when requested" }
# Get Node Type
Returns true or false depending if the node is a core one or not.
# Request
- Method: GET
- URL: /iscore
- Query Parameters in URL: None
# Response
Success
Code: 200
Return value:
{ "value": "True/False represents if the connected node is a core node", "atHeight": "Current block's height when requested" }
# Get Consensus Credentials of Height
Returns a list of the consensus members credentials at the current height or from a given height. The atHeight field of the response is always the current height of the node while the value field contains the list of credentials of the consensus nodes at the height that was requested.
# Request
- Method: GET
- URL: /consensus/credentials
- Query parameters in URL: Height
# Response
Success
Code: 200
Return value:
{ "value": { "ConsensusCredentials": { "Members": "The credentials for individual participants in consensus.", "QuorumCredentials": "Credentials for the quorum itself, in the case of multisig." } }, "atHeight": "Current block's height when requested" }
# Get Consensus Peers
Returns a list of the consensus peers that are connected to this node. The credentials of the current node will not be included in the list.
# Request
- Method: GET
- URL: /consensus/peers
- Query parameters in URL:
# Response
- Success
- Code: 200
- Return value:
{ "value": [ "<credentials>" // "Credentials of consensus peers" ], "atHeight": "Current block's height when requested" }
# Get State Proof
Returns a proof for the given entry key and table. The proof of existence is a bundle of hashes to prove the value hash of the specified item belongs to the Merkle tree of the root hash.
# Request
- Method: GET
- URL:
stateproof/{tableName}/{entryKey}
- Query parameters in URL: None
# Response
Success
Code: 200
Return value:
{ "value": { "TableProof": "Proof of existence for table", "TableEntryProof": "Proof of existence for entry" }, "atHeight": "Current block's height when requested" }
Object Not Found
- Code: 404
- Reason:
- Table or entry does not exist
Validation Error
- Code: 400
- Reason:
- entryKey is not a Byte string .
# Send Transaction
Submit a transaction to be added to the memory pool of a node if valid. It has to contain the transaction information on the request body. The value returned is the integral validation check of the transaction, not the actual result of it.
# Request
- Method: POST
- URL: /sendtx
- Query Parameters in URL: None
- Body:
{ "transactionRequest": { "Timestamp": "Time of the transaction generation", "ValidFrom": "Start time of the transaction’s validity", "ValidTo": "End time of the transaction’s validity", "Entries": "Transaction entries, can be created from client sdk", "RequiredCredentials": "The public keys of signers", "Evidence": "Signature of the transaction from signers" } }
# Response
Success
- Code: 200
- Return value:
{ "value": "Transaction Result Code(Duplicated, pending...)", "atHeight": "Current block's height when requested" }
Validation Error
- Code: 400
- Reason:
- Transaction Request is not complete or illegal.
# Send Transactions
Submit a set of transactions to be added to the memory pool of the node if all of them are valid. The value returned is the integral validation check of the transactions, not the actual result of them.
# Request
Method: POST
URL: /sendtxs
Query Parameters in URL: None
Body:
{ "transactionRequests": [ { "Timestamp": "Time of the transaction generation", "ValidFrom": "Start time of the transaction’s validity", "ValidTo": "End time of the transaction’s validity", "Entries": "Transaction entries, can be created from clientsdk", "RequiredCredentials": "The public keys of signers", "Evidence": "Signature of the transaction from signers" } ] }
# Response
Success
- Code: 200
- Return value:
{ "value": [ "<Result>" // Transaction Result Code of the sent transactions, ], "atHeight": "Current block's height when requested" }
Validation Error
- Code: 400
- Reason:
- Transaction Requests are not complete or illegal.