JSON-RPC 2.0 defines a stateless, transport-independent protocol for calling remote procedures using JSON. Requests, responses, named or positional parameters, notifications, identifiers, structured errors and batches give applications message rules without prescribing transport.
TL;DR:
- JSON-RPC 2.0 defines transport-agnostic remote procedure calls using JSON.
- Requests and responses use methods, parameters and matching identifiers.
- Notifications and batch calls have distinct response rules.
Summary
Protocol model
JSON-RPC 2.0 is a stateless remote-procedure-call protocol using JSON objects. It is transport agnostic, so the specification can be used over different message-delivery arrangements rather than prescribing one network connection.
Request and response objects
Requests identify a method, optional parameters and an identifier. Parameters may be positional or named. A response carries a result or structured error and uses the identifier to correlate it with the request.
Notifications and batches
A notification omits the identifier and does not receive a response. Batch processing groups requests in an array; responses are matched by identifier rather than assumed to follow request order.
Version and application scope
The published specification gives an origin date in March 2010 and an update in January 2013. It defines the RPC envelope, not application method meanings, authentication, transport security or payment settlement. Those requirements must be supplied by the service using it.
Keywords
- JSON-RPC
- RPC
- JSON Objects
- Method Names
- Named Parameters
- Positional Parameters
- Request IDs
- Notifications
- Error Objects
- Batch Calls