Last updated
Edit

Response Formatting

Responses are formatted slightly differently based on whether the method is called with the WebSocket, JSON-RPC, or Commandline interfaces. The Commandline and JSON-RPC interfaces use the same format because the Commandline interface calls JSON-RPC.

The fields of a successful response include:

FieldTypeRequired?Description
statusStringYesThe value success indicates the request was successfully received and understood by the server. Some client libraries omit this field on success.
typeStringYesThe value response indicates a direct response to an API request. Asynchronous notifications use a different value such as ledgerClosed or transaction.
resultObjectYesThe result of the query; contents vary depending on the API method.
id(Varies)NoArbitrary ID provided by the request that prompted this response. Omitted if the request didn't specify an ID.
warningStringNoIf this field is provided, the value is the string load. This means the client is approaching the rate limiting threshold where the server will disconnect this client.
warningsArrayNoIf this field is provided, it contains one or more Warnings Objects with important warnings. For details, see API Warnings.
forwardedBooleanNoIf true, this request and response have been forwarded from a Clio server to a P2P Mode server (and back) because the request requires data that is not available from Clio. The default is false.

Example Successful Response

{
  "id": 2,
  "status": "success",
  "type": "response",
  "result": {
    "account_data": {
      "Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
      "Balance": "27389517749",
      "Flags": 0,
      "LedgerEntryType": "AccountRoot",
      "OwnerCount": 18,
      "PreviousTxnID": "B6B410172C0B65575D89E464AF5B99937CC568822929ABF87DA75CBD11911932",
      "PreviousTxnLgrSeq": 6592159,
      "Sequence": 1400,
      "index": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05"
    },
    "ledger_index": 6760970
  }
}

API Warnings

When the response contains a warnings array, each member of the array represents a separate warning from the server. Each such Warning Object contains the following fields:

FieldTypeDescription
idNumberA unique numeric code for this warning message.
messageStringA human-readable string describing the cause of this message. Do not write software that relies the contents of this message; use the id (and details, if applicable) to identify the warning instead.
detailsObject(May be omitted) Additional information about this warning. The contents vary depending on the type of warning.

The following reference describes all possible warnings.

1001. Unsupported amendments have reached majority

Example warning:

"warnings" : [
  {
    "details" : {
      "expected_date" : 864030,
      "expected_date_UTC" : "2000-Jan-11 00:00:30.0000000 UTC"
    },
    "id" : 1001,
    "message" : "One or more unsupported amendments have reached majority. Upgrade to the latest version before they are activated to avoid being amendment blocked."
  }
]

This warning indicates that the one or more amendments to the XRP Ledger protocol are scheduled to become enabled, but the current server does not have an implementation for those amendments. If those amendments become enabled, the current server will become amendment blocked, so you should upgrade to the latest rippled version as soon as possible.

The server only sends this warning if the client is connected as an admin.

This warning includes a details field with the following fields:

FieldTypeDescription
expected_dateNumberThe time that the first unsupported amendment is expected to become enabled, in seconds since the Ripple Epoch.
expected_date_UTCStringThe timestamp, in UTC, when the first unsupported amendment is expected to become enabled.

Due to the variation in ledger close times, these times are approximate. It is also possible that the amendment fails to maintain support from >80% of validators until the specified time, and does not become enabled at the expected time. The server will not become amendment blocked so long as the unsupported amendments do not become enabled.

1002. This server is amendment blocked

Example warning:

"warnings" : [
  {
    "id" : 1002,
    "message" : "This server is amendment blocked, and must be updated to be able to stay in sync with the network."
  }
]

This warning indicates that the server is amendment blocked and can no longer remain synced with the XRP Ledger.

The server administrator must upgrade rippled to a version that supports the activated amendments.

2001. This is a clio server

Example warning:

"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"
  }
]

This warning indicates that the server answering the request a Clio server, which does not have direct access to the peer-to-peer network. Certain API methods behave differently or may have additional information, and requests that require non-validated data are forwarded to a peer-to-peer server.

It is generally safe to ignore this warning.

Caution
If you request ledger data without explicitly specifying a ledger version, Clio uses the latest validated ledger by default instead of the current in-progress ledger.

See Also