Skip to content

Commit e54ed22

Browse files
committed
add default api versioning
1 parent 27bcca7 commit e54ed22

File tree

1 file changed

+19
-2
lines changed
  • docs/references/http-websocket-apis

1 file changed

+19
-2
lines changed

docs/references/http-websocket-apis/index.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ metadata:
66
---
77
# HTTP / WebSocket APIs
88

9-
You can communicate directly with the XRP Ledger by `rippled` servers through the publicly available APIs.
9+
You can communicate with the XRP Ledger through the `rippled` servers' publicly available APIs.
1010

1111
Currently, there are two API versions: `1` and `2` {% badge href="https://github.com/XRPLF/rippled/releases/tag/2.0.0" %}New in: rippled 2.0.0{% /badge %}. The server reports the range of supported API versions in the `version` API method. <!-- STYLE_OVERRIDE: will --> <!-- TODO: add a link when `version` method is documented. -->
1212

13-
Separate API requests can use different API versions even on the same persistent connection. For example, if you connect WebSocket to a server that supports API versions 1 and 2, you can make an `account_tx` request using API version 2 and then make another `account_tx` request using API version 1 from the same connection.
13+
Separate API requests can use different API versions even on the same persistent connection. For example, if you connect through WebSocket to a server that supports API versions 1 and 2, you can make an `account_tx` request using API version 2 and then make another `account_tx` request using API version 1 from the same connection.
1414

1515
Future versions of `rippled` that introduce breaking changes will introduce a new API version 3.
1616

@@ -43,6 +43,23 @@ The following types of changes are **non-breaking changes** and may occur withou
4343
- Adding a new field to a request or response, not including positional parameters.
4444
- Adding a new API method.
4545

46+
47+
## Default API Versions
48+
49+
The table below shows which version of the `rippled` API is used if you don't specify it in the request:
50+
51+
| Request Format | API Version | Additional Notes |
52+
|----------------|-------------|------------------|
53+
| Websocket | 1 | |
54+
| JSON-RPC | 1 | |
55+
| Commandline | 2 | The commandline only uses the latest API version (currently 2). |
56+
| [xrpl.js](https://github.com/XRPLF/xrpl.js) | 2 | Defaults to [API v2][] starting in v4.0.0. |
57+
| [xrpl-py](https://github.com/XRPLF/xrpl-py) | 2 | Defaults to [API v2][] starting in v3.0.0. |
58+
59+
{% admonition type="info" name="Note" %}
60+
[API v2][] is used by default when you make a request to a Clio server, starting in v???.
61+
{% /admonition %}
62+
4663
{% raw-partial file="/docs/_snippets/common-links.md" /%}
4764

4865
{% child-pages /%}

0 commit comments

Comments
 (0)