Get a List of Block's Data
get
/console/admin/api/v2/channels/{channelName}/blocks
Using the channel name, a block ID range, and a time range, you can get a list of the block's data for a range of blocks on a channel, including transactions, deployments, and invocations.
- The time range and ID range can not be enabled together.
- If ID range is specified, time range won't take effect.
- This API returns 1000 blocks data at most.
- If no parameter is specified, it will return the latest 1000 blocks.
- If only fromId(since) is input, the toId(until) will be set as the current ledger height by default.
- If only toId(until) is input, the fromId(since) will be set as 0 by default.
- If the query range is beyond this value, an error message will be returned.
Request
Supported Media Types
- application/json
Path Parameters
-
channelName(required): string
Channel name
Query Parameters
-
fromId: number
The beginning ID of the selected block range
-
since: string
The beginning UTC time of the selected block range in the format YYYYMMDDHHmmSS
-
toId: number
The end ID of the selected block range
-
until: string
The end UTC time of the selected block range in the format YYYYMMDDHHmmSS
Response
Supported Media Types
- application/json
200 Response
Retrieved block statistics information successfully
Nested Schema : data
Type:
object
Nested Schema : header
Type:
object
400 Response
Invalid argument
401 Response
Unauthorized
500 Response
Internal server error
Default Response
Unexpected error