×
  • General description of the interface
  • Application Guide

Description of JSON-RPC

Our JSON-RPC interface is thoughtfully based on XML-RPC, but solves some of its shortcomings for easier use.

The name of the called method is the path in the URL, so for example, the call to the dummy method is written as /dummy.

Call options

This JSON-RPC server allows you to call methods in several ways:

  • HTTP GET - basic method call. Parameters are passed as GET parameters in URL.
  • HTTP POST - method parameters are spassed using POST like form values. POST values are prosessed this way only if HTTP header Content-Type: application/x-www-form-urlencoded is set.
  • HTTP POST JSON - method parametrs are encoded as JSON object, where keys are method parameters. Request is processed this way if HTTP header application/json, text/json or text/plain is set.

Response format

Interface responds with data encoded in JSON. The response always contains an object with the status and status_message keys. Status is a number with meaning similar to HTTP status codes, but may differ where there is no corresponding HTTP status. Status_message then contains a text description of the call result. If the call is successful, the answer is {“status”: 200, “status_message”: “OK”}. If the call returns some data, the root object contains a key with the name of the called method. Methods response data can be found under this key..

Example:

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
}

System methods

The server provides several system methods. The most important are:

  • system_method_help - Returns help for method. Example call: /system_method_help?method=xxx.
  • system_list_methods - Returns all methods available on interface.
  • system_alive - Used for monitoring system availability.
  • system_method_info - Simple formated text description of method. You can add GET patameters html=1 and devel=1.
  • system_method_json_schema - Returns json-schema for request validation.
  • system_method_response_json_schema - Returns json-schema for response validation.

Using this web tool

You can load or reload methods using "Load" button. Method signatures and help is loaded with click on specific method in left column. Than you can try calling method and check response.
This tool is not intended for use in a production environment. Its main purpose is to introduce the interface and facilitate the development of an application using this interface.