Core
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.
The knowledge map ID to start a session against
Flag to use the draft version of the knowledge map, cannot be used simultaneously with 'version' parameter
Parameter to use a specific version of the map, cannot be used simultaneously with 'useDraft' parameter
GET /start/{kmID} HTTP/1.1
Host: api.rainbird.ai
X-API-Key: YOUR_API_KEY
Accept: */*
Session start information
{
"id": "12345678-1234-1234-1234567890ac",
"kmVersion": {
"id": "abcdefgh-abcd-abcd-abcdefghijkl"
}
}
The session to inject facts into
The subject side concept instance or value
The relationship between subject and object
The object side concept instance or value
How certain this fact or answer is
POST /{sessionID}/inject HTTP/1.1
Host: api.rainbird.ai
Content-Type: application/json
Accept: */*
Content-Length: 323
[
{
"subject": "John",
"relationship": "lives in",
"object": "England",
"certainty": 100
},
{
"subject": "Will",
"relationship": "lives in",
"object": "England",
"certainty": 100
},
{
"subject": "Ellie",
"relationship": "lives in",
"object": "England",
"certainty": 100
},
{
"subject": "David",
"relationship": "lives in",
"object": "England",
"certainty": 100
}
]
Facts were injected successfully
{
"result": "OK"
}
The session to query against
The subject side concept instance or value
The relationship between subject and object
The object side concept instance or value
POST /{sessionID}/query HTTP/1.1
Host: api.rainbird.ai
Content-Type: application/json
Accept: */*
Content-Length: 42
{
"subject": "John",
"relationship": "speaks"
}
An answer if one is reached, or a question
{
"result": [
{
"subject": "text",
"relationshipType": "text",
"object": "text",
"certainty": 1,
"factID": "text",
"relationship": "text",
"subjectMetadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"objectMetadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
],
"queryProfile": [],
"sid": "text",
"stats": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
The session to send responses to
POST /{sessionID}/response HTTP/1.1
Host: api.rainbird.ai
Content-Type: application/json
Accept: */*
Content-Length: 93
{
"answers": [
{
"subject": "John",
"relationship": "lives in",
"object": "England",
"certainty": 100
}
]
}
An answer if one is reached, or a question
{
"result": [
{
"subject": "text",
"relationshipType": "text",
"object": "text",
"certainty": 1,
"factID": "text",
"relationship": "text",
"subjectMetadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"objectMetadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
],
"queryProfile": [],
"sid": "text",
"stats": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
The session to step back with an undo
POST /{sessionID}/undo HTTP/1.1
Host: api.rainbird.ai
Content-Type: application/json
Accept: */*
Content-Length: 2
{}
Session stepped back to a previous question or answer
{
"result": [
{
"subject": "text",
"relationshipType": "text",
"object": "text",
"certainty": 1,
"factID": "text",
"relationship": "text",
"subjectMetadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"objectMetadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
],
"queryProfile": [],
"sid": "text",
"stats": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}