-
Notifications
You must be signed in to change notification settings - Fork 0
RPC API reference
This page documents the main ChRIS web-based RPC API. It is organized according to main logical components, including the base objects, the homepage objects, plugin objects, feed objects, etc.
JSON objects returned by calls to ChRIS consist of four components, the actual command executed cmd, the API call string from the agent API, an authorization component auth, and finally an exec component that contains the actual output of the call.
The cmd is the python level code that ChRIS called internally, at the scope of the main function.
The API is the API string as passed from the external agent, typically a browser. ChRIS echoes this back to the client to allow for consistency checking.
The auth section contains importantly the sessionSeed for the next API call of this user. The client needs to add the correct session hash to its next call, based on the sessionSeed in order to be authenticated.
The exec section contains the JSON formatted actual output from executing the call.
There is one base object in the system, the chris object itself. It is responsible for user login, session management, user configuration, etc.
| method | parameters |
|---|---|
| login | user='',passwd='' |
Typical return
"cmd": { "pycode": "d=auth(lambda: chris.login(user='chris',passwd='chris1234'))" },
"API": {
"APIcall": "http://chris_service?returnstore=d&object=chris&method=login¶meters=user='chris',passwd='chris1234'&clearSessionFile=1"
},
"auth": { "sessionSeed": "1", "sessionStatus": true },
"exec": {
"sessionSeed": "1",
"APIcanCall": false,
"loginStatus": true,
"loginTimeStamp": "2015-06-18_16:34:08.686656",
"loginMessage": "Successful login at 2015-06-18 16:34:08.686695.",
"logoutMessage": "",
"sessionStatus": true,
"sessionToken": "ABCDEF"
}