Rainbird Engine - v2.0 (1.2.0)

Download OpenAPI specification:Download

Welcome to the Rainbird API documentation for the v2.0 engine. It contains details of the API calls required to perform Rainbird queries against a Knowledge Map

Authentication

basicAuth

To authenticate with the Rainbird API, you should pass your apikey as the 'username' portion of the basic auth scheme. The 'password' portion is not used by Rainbird, it is however a required field in the interactive 'Try it' UI so please enter any character in that field.

Security Scheme Type HTTP
HTTP Authorization Scheme basic

evidenceKey

To access secured evidence, you should pass your evidence key

Security Scheme Type API Key
Header parameter name: x-evidence-key

interactionKey

To access secured interaction logs, you should pass your interaction key

Security Scheme Type API Key
Header parameter name: x-interaction-key

Start - Start a new session

This endpoint starts a new session that can be used in subsequent API calls. By default it will start a session using the live version of the given knowledge map. If no version has been set live it will default to using the draft version. Alternatively the query parameters “useDraft” or “version” can be used as an override to request either the draft or a specific version.

Authorizations:
path Parameters
kmID
required
string

The knowledge map ID to start a session against

query Parameters
useDraft
boolean

Flag to use the draft version of the knowledge map, cannot be used simultaneously with 'version' parameter

version
integer

Parameter to use a specific version of the map, cannot be used simultaneously with 'useDraft' parameter

Responses

Request samples

curl -i -X GET \
  -u <username>:<password> \
  'https://api.rainbird.ai/start/:kmID?useDraft=true&version=0'

Response samples

Content type
application/json
{
  • "id": "12345678-1234-1234-1234567890ac",
  • "kmVersion": {
    }
}

Inject - Inject facts into a session

path Parameters
sessionID
required
string

The session to inject facts into

Request Body schema: application/json

Array of facts to inject

Array ()
required
string or number or boolean (Subject)

The subject side concept instance or value

relationship
required
string (Relationship)

The relationship between subject and object

required
string or number or boolean (Object)

The object side concept instance or value

certainty
required
number (Certainty) [ 1 .. 100 ]

How certain this fact or answer is

Responses

Request samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    },
  • {
    }
]

Response samples

Content type
application/json
{
  • "result": "OK"
}

Query - Query a running session

path Parameters
sessionID
required
string

The session to query against

Request Body schema: application/json

Query for the engine to try to answer

string or number or boolean (Subject)

The subject side concept instance or value

relationship
required
string (Relationship)

The relationship between subject and object

string or number or boolean (Object)

The object side concept instance or value

Responses

Request samples

Content type
application/json
{
  • "subject": "John",
  • "relationship": "speaks"
}

Response samples

Content type
application/json
Example
{
  • "result": [
    ],
  • "queryProfile": [ ],
  • "sid": "string",
  • "stats": { }
}

Response - Respond to an asked question

path Parameters
sessionID
required
string

The session to send responses to

Request Body schema: application/json

Items to send as a response

Array of objects

Responses

Request samples

Content type
application/json
{
  • "answers": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "result": [
    ],
  • "queryProfile": [ ],
  • "sid": "string",
  • "stats": { }
}

Undo - Undoes previous interaction with the engine

path Parameters
sessionID
required
string

The session to step back with an undo

Request Body schema: application/json

An empty object

object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
Example
{
  • "result": [
    ],
  • "queryProfile": [ ],
  • "sid": "string",
  • "stats": { }
}

Evidence - Returns the evidence for a given fact

Authorizations:
path Parameters
factID
required
string

The factID for which to retrieve evidence

sessionID
required
string

The sessionID where the fact was created

Responses

Request samples

curl -i -X GET \
  https://api.rainbird.ai/analysis/evidence/:factID/:sessionID

Response samples

Content type
application/json
{
  • "factID": "WA:RF:46270715221c02dca319bd10",
  • "source": "rule",
  • "fact": {
    },
  • "time": 1522060091106,
  • "rule": {
    }
}

Version - Reports engine version

Responses

Request samples

curl -i -X GET \
  https://api.rainbird.ai/version

Interaction Log - Retrieves interaction events

Authorizations:
path Parameters
sessionID
required
string

The session id to access the interaction logs

query Parameters
format
string

Format of the retrieved data. CSV or JSON

Responses

Request samples

curl -i -X GET \
  'https://api.rainbird.ai/analysis/interactions/:sessionID?format=string'

Response samples

Content type
application/json
Example
{
  • "values": {
    },
  • "event": "start",
  • "created": "2022-03-04T10:13:04.224Z"
}

Session - Returns session information

Authorizations:
path Parameters
sessionID
required
string

The sessionID of the session

query Parameters
filter
Array of strings
Default: ["version"]

The type of information requested.

Items Enum: "version" "facts"

Responses

Request samples

curl -i -X GET \
  -u <username>:<password> \
  'https://api.rainbird.ai/analysis/session/:sessionID?filter=version'

Response samples

Content type
application/json
{
  • "km": {
    },
  • "facts": {
    }
}