Metainformationen zur Seite

LoxBerry JsonRPC

To use LoxBerry's SDK functions with every programming language, we provide an JsonRpc interface (1.0 and 2.0 compatible). 

You should use an JsonRPC client in your language - it will do all for you.

Our JsonRpc interface provides the methods of the LoxBerry PHP SDK. In detail, the methods of following libs are included:

The method name is equal to the PHP's function name. It is not required to prefix the class names (therefore: LBWeb::loglevel_select_html can be written as loglevel_select_html).

Interface URL

http://localhost:80/admin/system/jsonrpc.php

For localhost, no authentication is required (But! For remote connections, the user credentials are required! So use localhost) 

Parameters

Please use the PHP documentation for function and parameter description.

To "convert" the PHP documentation to JsonRPC method calls, see this list:

  • For methods without parameters, use [] 
  • For a list of parameters, use [ "paramter1", "parameter2", "parameter3" ] 
  • For named parameters in an array, use [ { PARAM1: 'Value1', PARAM2: 'Value2 } ] 

Result

The datatype of the result depends on the function call. JsonRPC client libraries usually convert the result to the correct datatype: an int, float or string for single results, or an object or array for datasets. Use a dumper to figure out, how your JsonRPC lib returns the values.

Unknown or non-allowed methods return a method error. Parameter errors also may throw an exception.

Special methods

  • getdirs [ "pluginname" ] → Using your pluginname as parameter, returns a dataset of all directories of the named plugin (e.g. lbphtmlauthdir, lbpconfigdir, lbpdatadir). The names are equal to the constants/globals of PHP (PHP Module loxberry_system.php).
  • get_lbheader [ parameters ] and get_lbfooter []→ This returns ready HTML code of LoxBerry's header page.  Don't use lbheader or lbfooter, but get_lbheader and get_lbfooter. See PHP functions to create your webpage with LoxBerry design. NavBar is currently not supported by a method.


Our JsonRpc interface is in an early stage. If you have issues, contact us with an issue at GitHub, or join our Developer WhatsApp group (first contact by email → mail addresses).