Skip to content
Rudolph Pienaar edited this page Jun 23, 2015 · 1 revision

RPC API reference

Overview

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.

Structure of JSON objects returned by ChRIS

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.

cmd

The cmd is the python level code that ChRIS called internally, at the scope of the main function.

API

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.

auth

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.

exec

The exec section contains the JSON formatted actual output from executing the call.

chris Base object

There is one base object in the system, the chris object itself. It is responsible for user login, session management, user configuration, etc.

methods

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&parameters=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"
    }

homePage object

plugin object

Clone this wiki locally