wiki:i2pcontrol

Version 1 (modified by tuna, 4 years ago) (diff)

This page will outline the API2 for i2pcontrol

Developer headsup!

  • The "token" parameter in requests have been renamed from "Token" to the all lower case "token". The reason for this is to make the API as intuitive and predictable as possible.

API 2

{
  "id": **id**,
  "method": **method_name**,
  "params": {
    "token": "**auth_token**"
    "method_argument": **method_argument_value**,

  },
  "jsonrpc": "2.0"
}

{
  "id": **id**,
  "result": **result_value**,
  "jsonrpc": "2.0"
}
  • id - The id number or the request, it's used to identify which reply was spawn by which request
  • method_name - The method name is the name of the RPC that is being invoked
  • auth_token - This is the session authentication token, it needs to be supplied with every RPC except for the 'authenticate' call
  • method_argument_value - This is the method argument. It is used to offer a different flavors of a method. Like 'get', 'set' and flavors like that.
  • result_value - This is the value that RPC returns. Its type and contents depends on the method and which method

Prefixes

The naming for will be done similar to how it's done in CSS, with vendor prefixes for the different API implementations (i2p, kovri, i2pd).

XXX.YYY.ZZZ
i2p.XXX.YYY.ZZZ
i2pd.XXX.YYY.ZZZ
kovri.XXX.YYY.ZZZ

The overall idea with vendor specific prefixes to allow for some wiggle room and let vendors innovate without having to wait for every other implementation to catch up. If is implemented by all implementations it can be moved under the umbrella of the next API version

Methods

  • authenticate
    • *Argument:* {password [string]
      • returns:
        {
          "token" : [string],
          "api" : [int]
        }