Changes between Initial Version and Version 1 of i2pcontrol


Ignore:
Timestamp:
Jan 20, 2016 7:13:45 PM (5 years ago)
Author:
tuna
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • i2pcontrol

    v1 v1  
     1This page will outline the API2 for i2pcontrol
     2
     3== Developer headsup!==
     4 * 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.
     5
     6== API 2 ==
     7
     8
     9{{{
     10{
     11  "id": **id**,
     12  "method": **method_name**,
     13  "params": {
     14    "token": "**auth_token**"
     15    "method_argument": **method_argument_value**,
     16
     17  },
     18  "jsonrpc": "2.0"
     19}
     20
     21{
     22  "id": **id**,
     23  "result": **result_value**,
     24  "jsonrpc": "2.0"
     25}
     26}}}
     27
     28  * **id** - The id number or the request, it's used to identify which reply was spawn by which request
     29  * **method_name** - The method name is the name of the RPC that is being invoked
     30  * **auth_token** - This is the session authentication token, it needs to be supplied with every RPC except for the 'authenticate' call
     31  * **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.
     32  * **result_value** - This is the value that RPC returns. Its type and contents depends on the method and which method
     33
     34=== Prefixes ===
     35
     36The naming for will be done similar to how it's done in CSS, with vendor prefixes for the different API implementations (i2p, kovri, i2pd).
     37
     38{{{
     39XXX.YYY.ZZZ
     40i2p.XXX.YYY.ZZZ
     41i2pd.XXX.YYY.ZZZ
     42kovri.XXX.YYY.ZZZ
     43}}}
     44
     45The 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.
     46If is implemented by all implementations it can be moved under the umbrella of the next API version
     47
     48=== Methods ===
     49
     50 * authenticate
     51   * *Argument:*  {password [string]
     52     * returns:
     53{{{
     54{
     55  "token" : [string],
     56  "api" : [int]
     57}
     58}}}