Aptos · Example Payload

Get_Block_By_Version

This endpoint allows you to get the transactions in a block and the corresponding block information given a version in the block. Transactions are limited by max default transactions size. If not all transactions are present, the user will need to query for the rest of the transactions via the get transactions API. If the block has been pruned, it will return a 410

Blocks

Get_Block_By_Version is an example object payload from Aptos, with 9 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

methodpathoperationIdsummarydescriptiontagsparametersrequestBodyresponses

Example Payload

Raw ↑
{
  "method": "GET",
  "path": "/blocks/by_version/{version}",
  "operationId": "get_block_by_version",
  "summary": "Get blocks by version",
  "description": "This endpoint allows you to get the transactions in a block\nand the corresponding block information given a version in the block.\n\nTransactions are limited by max default transactions size.  If not all transactions\nare present, the user will need to query for the rest of the transactions via the\nget transactions API.\n\nIf the block has been pruned, it will return a 410",
  "tags": [
    "Blocks"
  ],
  "parameters": [
    {
      "name": "version",
      "in": "path",
      "required": true,
      "description": "Ledger version to lookup block information for.",
      "schema": {
        "type": "integer",
        "format": "uint64"
      }
    },
    {
      "name": "with_transactions",
      "in": "query",
      "required": false,
      "description": "If set to true, include all transactions in the block\n\nIf not provided, no transactions will be retrieved",
      "schema": {
        "type": "boolean"
      }
    }
  ],
  "requestBody": null,
  "responses": {
    "200": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/Block"
      },
      "example": {}
    },
    "400": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/AptosError"
      },
      "example": {}
    },
    "403": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/AptosError"
      },
      "example": {}
    },
    "404": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/AptosError"
      },
      "example": {}
    },
    "410": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/AptosError"
      },
      "example": {}
    },
    "500": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/AptosError"
      },
      "example": {}
    },
    "503": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/AptosError"
      },
      "example": {}
    }
  }
}