Remote Procedure Call (RPC) Interface
- API Status:
- XML-RPC is available
- JSON-RPC is ${xmlrpc.json and 'available' or 'not available'}
RPC exported functions
-
${namespace.namespace} - ${namespace.description}
-
Function Description Permission required ${function[0]} ${function[1]} ${function[2] or "By resource"}
Calling Methods
XML and JSON libraries for remote procedure calls and parsing exists for all major languages and platforms - use a tested, standard library for consistent results.
The following are examples for illustration only, and shows raw access to RPC using curl (with Content-Type and Body for POST request):
XML-RPC example
user: ~ > cat body.xml <?xml version="1.0"?> <methodCall> <methodName>wiki.getPage</methodName> <params> <param><string>WikiStart</string></param> </params> </methodCall> user: ~ > curl -H "Content-Type: application/xml" --data @body.xml ${req.abs_href.xmlrpc()} <?xml version='1.0'?> <methodResponse> <params> <param> <value><string>= Welcome to....
- Use ${req.abs_href.login('xmlrpc')} with basic authentication for user context.
JSON-RPC example
user: ~ > cat body.json {"params": ["WikiStart"], "method": "wiki.getPage", "id": 123} user: ~ > curl -H "Content-Type: application/json" --data @body.json ${req.abs_href.jsonrpc()} {"id": 123, "error": null, "result": "= Welcome to....
- JSON-RPC has no formalized type system, so a class-hint system is used
for input and output of non-standard types:
- {"__jsonclass__": ["datetime", "YYYY-MM-DDTHH:MM:SS"]} = DateTime (UTC)
- {"__jsonclass__": ["binary", "<base64-encoded>"]} = Binary
- "id" is optional, and any marker value received with a request is returned with the response.
- Use ${req.abs_href.login('jsonrpc')} with basic authentication for user context.