Accessing the EMEN2 Public API using JSON-RPC and XML-RPC

All public API methods are available via JSON-RPC, which is a language-neutral Remote Procedure Call protocol based on the JSON standard. We have published a simple JSON-RPC module for Python and JavaScript (described below) that can be used with EMEN2. In the future, we plan to provide similar access via a simpler REST API.

JSON-RPC

Example:

>>> import jsonrpc.proxy

>>> import getpass

>>> db = jsonrpc.proxy.JSONRPCProxy("http://ncmidb.bcm.edu")

>>> db.login("example@example.com", getpass.getpass())
Password: 

>>> db.record.get(0)
{u'modifyuser': u'root', u'name': 0, u'creator': u'root', u'keytype': u'record', u'creationtime': u'2007-07-23T15:30:22+00:00', u'uri': None, u'comments': [], u'rectype': u'folder', u'history': [[u'root', u'2010-04-27T19:28:05+00:00', u'recname', u'EMEN2'], [u'root', u'2010-04-27T19:28:05+00:00', u'name_folder', None]], u'parents': [], u'groups': [u'authenticated'], u'modifytime': u'2010-04-27T19:28:05+00:00', u'name_folder': u'EMEN2', u'children': [268323, 449989, 268295, 136, 433788, 268330, 448491, 492525, 265550, 268336, 358307, 265561, 265514, 270940, 260317, 266174], u'permissions': [[], [], [], []]}

EMEN2/rpc (last edited 2013-04-18 06:19:00 by IanRees)