Our JSON-RPC interface is conceptually based on XML-RPC but addresses some of its shortcomings for easier use.
The name of the called method is the path in the URL, so for example calling the items method is written as /items.
This JSON-RPC server allows calling methods in several ways:
_, _callback, or callback parameter. When the call includes one of these parameters, the response is automatically returned via JSONP. More about JSONP on Wikipedia.Content-Type: application/x-www-form-urlencoded.application/json, text/json, or text/plain for JSON and application/bson for BSON.The interface responds either with JSON or BSON depending on the Accept HTTP header. The default response format is JSON.
The response always contains an object with keys status and status_message. Status is a numeric completion state similar to HTTP status codes, but may differ where no corresponding HTTP status exists. Status_message contains a text description of the call result. For a successful call the response is {"status":200, "status_message": "OK"}.
If the call returns data, the root object also contains a key with the name of the called method.
GET /system_list_methods HTTP/1.0
User-Agent: curl/7.37.1
Host: dummy.grandit.cz:1200
Accept: */*
HTTP/1.1 200 OK
Content-Type: application/json
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: Reply-OK-Only
Connection: Close
Content-Length: __
{
"status_message": "OK",
"system_list_methods": [
"system_alive",
"system_list_methods",
"system_method_help",
"system_method_info",
"system_method_sig",
"system_multicall",
"system_status",
],
"status": 200
}
If you enter the address of our RPC interface in the input field, you can load its configuration by clicking the button. Loading the interface configuration loads both method signatures and help. Using this interface you can also call individual methods and view the return values.
For security, all methods require the token parameter defined as JWT.