Files
xrpl-dev-portal/docs/references/http-websocket-apis/public-api-methods/clio-methods/version.md
2024-05-20 12:37:21 -07:00

2.4 KiB

seo, labels
seo labels
description
Retrieve API version information.
Core Server

version

[Source]

The version command asks the Clio server for API version information. For rippled servers, see version (rippled) instead. {% badge href="https://github.com/XRPLF/clio/releases/tag/1.0.0" %}New in: Clio v2.0.0{% /badge %}

Request Format

An example of the request format:

{% tabs %}

{% tab label="WebSocket" %}

{
    "command": "version"
}

{% /tab %}

{% tab label="JSON-RPC" %}

{
    "method": "version",
    "params": [
        {}
    ]
}

{% /tab %}

{% /tabs %}

The request does not take any parameters.

Response Format

An example of a successful response:

{% tabs %}

{% tab label="WebSocket" %}

{
  "result": {
    "version": {
      "first": 1,
      "last": 2,
      "good": 1
    }
  },
  "status": "success",
  "type": "response",
  "warnings": [
    {
      "id": 2001,
      "message": "This is a clio server. clio only serves validated data. If you want to talk to rippled, include 'ledger_index':'current' in your request"
    }
  ]
}

{% /tab %}

{% tab label="JSON-RPC" %}

200 OK

{
    "result": {
      "version": {
        "first": 1,
        "last": 2,
        "good": 1
      }
    },
    "status": "success",
    "type": "response",
    "warnings": [
        {
            "id":2001,
            "message":"This is a clio server. clio only serves validated data. If you want to talk to rippled, include 'ledger_index':'current' in your request"
        }
    ]
}

{% /tab %}

{% /tabs %}

The response follows the [standard format][], with a successful result containing an info object as its only field.

The version object returns some arrangement of the following fields:

Field Type Description
first Integer Lowest supported API release
last Integer Highest supported API release
good Integer Default API if none specified

Possible Errors

  • Any of the [universal error types][].

{% raw-partial file="/docs/_snippets/common-links.md" /%}