Remote Procedure Call (RPC) interface
RPC calls are handled via the
JsonRpcContrib
. Callers must authenticate
as admins, or the request will be rejected with a 403 status.
Note: If Foswiki is running in 'bootstrap' mode (without a LocalSite.cfg)
then
all calls are automatically assumed to be from an admin. As soon
as a LocalSite.cfg is put in place, then the authentication set up
therein will apply, and users are required to logged in as admins.
Entry points for each of the static methods published by the
Foswiki::Configure::Query class are supported. See that class for
descriptions.
Invocation examples
Call using a URL of the format:
https://wiki.biohack.net/bin/jsonrpc/configure
while POSTing a request encoded according to the JSON-RPC 2.0 specification:
{
jsonrpc: "2.0",
method: "getspec",
params: {
get : { keys: "{DataDir}" },
depth : 0
},
id: "caller's id"
}
The format of .spec files is documented in detail in
There are two node types in the .spec tree:
SECTIONs have:
-
headline
(default UNKNOWN
, the root is usually '')
-
typename
(always SECTION
)
-
children
- array of child nodes (sections and keys)
Key entries (such as
{DataDir}
) have:
-
keys
e.g. {Store}{Cupboard}
-
typename
(from the .spec)
- Other keys from the .spec e.g.
SIZE
, FEEDBACK
, CHECK