API¶
Things you should know:
- The API is a JSON-RPC api v2.0 more info see http://en.wikipedia.org/wiki/JSON-RPC
- It runs on its own port, default is 8086
- The api key MUST be present in all methods except xdm.api.ping and xdm.api.version
Note
At the time of writing i failed to make a connection to XDM / the api from a webpage due to cross origin domain security issues. I was also not able to add a websocket implementation to the api.
Warning
The api might completely change. goal is to have an api as XBMC provides. (Websockets and HTTP with an JSONRPC protocol)
Access¶
You must provider the api key either as the first none keyword argument or as a keyoword argument witht the name apikey.
Example in python¶
Using JSONRPClib
>>>> import jsonrpclib
>>>> server = jsonrpclib.Server('http://localhost:8086')
>>>> server.ping()
u'pong'
>>>> server.system.listMethods('6vVSMLSDB9vPZkftahVwfBirjzvYzPuih3V6hmO1Nhk')
[u'ping', u'plugins.cache', u'plugins.getActiveMediaTypes', u'system.listMethods', u'system.methodHelp', u'system.methodSignature', u'system.reboot', u'system.shutdown', u'version']
Namespace: None¶
-
xdm.api.
ping
(pong='pong')¶ Returns pong nice way to test the connections
-
xdm.api.
version
()¶ Returns the XDM version tuple as a list e.g. [0, 4, 13, 0]
Namespace: system¶
-
xdm.api.system.
listMethods
()¶ Return a list of available method names
-
xdm.api.system.
methodHelp
(mehtodeName='system.methodHelp')¶ This method returns a text description of a particular method. The method takes one parameter, a string. Its value is the name of the jsonrpc method about which information is being requested. The result is a string. The value of that string is a text description, for human use, of the method in question.
- Keyword arguments:
- mehtodeName – str The name of the method (default ‘system.methodHelp’)
- Return:
- str The documentation text of the method.
-
xdm.api.system.
methodSignature
(mehtodeName='system.methodSignature')¶ Returns the signature of methodName as an list of list each list item is a list that contains the return value type as the first value all remaining values (if any) are value types that are accepted during call.
-
xdm.api.system.
reboot
()¶ just return True and starts a thread to reboot XDM
-
xdm.api.system.
shutdown
()¶ just return True and starts a thread to shutdown XDM