Rippled API Overview
Business servers interact with the Ripple network by sending JSON formatted messages to their local rippled server. In reply rippled sends back JSON formatted responses.
There are two broad categories of JSON messages.
- Queries which return information about the current state of the server or the ledger.
- Transactions which change the state of the server or ledger.
All JSON messages are documented on this wiki page: JSON Messages
JSON data formatting rules are specified here: JSON format
The current state of every account, trust line and market offer is represented in the Ripple ledger. The ledger format is documented here: Ledger Format
Transaction types and formats are listed here: Transactions
Websockets vs RPC
Messages can be passed either by making individual RPC calls to the rippled server, or by opening a persistent websocket connection and submitting JSON requests over that channel. The individual JSON requests and responses use the same data format no matter which communication channel you chose to use.
The choice of communication channel is up to the integrator. The choice often depends on the language the existing business server is written in and the skills of the development team. Websockets is a more modern interface and is more suitable to high volume businesses. It is also allows user interfaces to update dynamically. RPC’s synchronous nature makes it easy for quick experimentation. https://ripple.com/wiki/Websocket_API#Websocket_vs_RPC
Higher level interfaces
The rippled executable also provides a command line interface that simplifies sending RPC requests to your server. Command Line Agent
API's for Integration
We recommend that most new integratiors write to the REST api. However, the other APIs continue to be supported.
- rippled Command Line
- This is the easiest way to submit manual commands to rippled. It requires building rippled locally. The CLI submits RPC commands to the rippled server configured in rippled.cfg.
- JSON RPC
- This is useful for its ease in submitting simple CURL commands. Connections are HTTP request/response style.
- Web Sockets
- This provides a continuous connection between your integration's server and rippled. It also simplifies subscribing to ledger notifications.
- This is a separate server written in node.js. It flattens and minimizes the number of JSON message formats in order to make it easier to integrate from statically compiled (class based) languages. Ripple-REST uses ripple-lib to submit transactions over web sockets.