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
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 |
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.
kmID required | string The knowledge map ID to start a session against |
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 |
curl -i -X GET \ -u <username>:<password> \ 'https://api.rainbird.ai/start/:kmID?useDraft=true&version=0'
{- "id": "12345678-1234-1234-1234567890ac",
- "kmVersion": {
- "id": "abcdefgh-abcd-abcd-abcdefghijkl"
}
}
sessionID required | string The session to inject facts into |
Array of facts to inject
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 |
[- {
- "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
}
]
{- "result": "OK"
}
sessionID required | string The session to query against |
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 |
{- "subject": "John",
- "relationship": "speaks"
}
{- "result": [
- {
- "subject": "string",
- "relationshipType": "string",
- "object": "string",
- "certainty": 1,
- "factID": "string",
- "relationship": "string",
- "subjectMetadata": { },
- "objectMetadata": { }
}
], - "queryProfile": [ ],
- "sid": "string",
- "stats": { }
}
sessionID required | string The session to send responses to |
Items to send as a response
Array of objects |
{- "answers": [
- {
- "subject": "John",
- "relationship": "lives in",
- "object": "England",
- "certainty": 100
}
]
}
{- "result": [
- {
- "subject": "string",
- "relationshipType": "string",
- "object": "string",
- "certainty": 1,
- "factID": "string",
- "relationship": "string",
- "subjectMetadata": { },
- "objectMetadata": { }
}
], - "queryProfile": [ ],
- "sid": "string",
- "stats": { }
}
sessionID required | string The session to step back with an undo |
An empty object
{ }
{- "result": [
- {
- "subject": "string",
- "relationshipType": "string",
- "object": "string",
- "certainty": 1,
- "factID": "string",
- "relationship": "string",
- "subjectMetadata": { },
- "objectMetadata": { }
}
], - "queryProfile": [ ],
- "sid": "string",
- "stats": { }
}
factID required | string The factID for which to retrieve evidence |
sessionID required | string The sessionID where the fact was created |
curl -i -X GET \ https://api.rainbird.ai/analysis/evidence/:factID/:sessionID
{- "factID": "WA:RF:46270715221c02dca319bd10",
- "source": "rule",
- "fact": {
- "subject": {
- "type": "person",
- "value": "Bob",
- "dataType": "string"
}, - "relationship": {
- "type": "speaks"
}, - "object": {
- "type": "language",
- "dataType": "string",
- "value": "English"
}, - "certainty": 75
}, - "time": 1522060091106,
- "rule": {
- "bindings": {
- "S": "Bob",
- "O": "English",
- "COUNTRY": "England"
}, - "conditions": [
- {
- "subject": "England",
- "relationship": "national language",
- "object": "English",
- "salience": 100,
- "certainty": 100,
- "impact": 37.5,
- "factID": "WA:KF:7ccf0415f3af204b5eb3",
- "objectType": "string",
- "factKey": "1a1a1a1a-1a1a-1a1a-1a1a-1a1a1a1a1a1a1"
}, - {
- "subject": "Bob",
- "relationship": "lives in",
- "object": "England",
- "salience": 100,
- "certainty": 100,
- "impact": 37.5,
- "factID": "WA:AF:8e5b2c204b5eb3b24ba1",
- "objectType": "string",
- "factKey": "1b1b1b1b-1b1b-1b1b-1b1b-1b1b1b1b1b1b1"
}
], - "ruleMaxCertainty": 75
}
}
sessionID required | string The session id to access the interaction logs |
format | string Format of the retrieved data. CSV or JSON |
curl -i -X GET \ 'https://api.rainbird.ai/analysis/interactions/:sessionID?format=string'
{- "values": {
- "start": {
- "useDraft": true,
- "kmVersionID": "fb215245-4be2-4d23-a64c-97c50530684f",
- "sessionID": "b77cdb34-5904-4dac-9fe9-3697ed1d73e3"
}
}, - "event": "start",
- "created": "2022-03-04T10:13:04.224Z"
}
sessionID required | string The sessionID of the session |
filter | Array of strings Default: ["version"] The type of information requested. |
curl -i -X GET \ -u <username>:<password> \ 'https://api.rainbird.ai/analysis/session/:sessionID?filter=version'
{- "km": {
- "id": "abcdefgh-abcd-abcd-abcdefghijkl",
- "name": "speaks",
- "versionID": "abcdefgh-abcd-abcd-abcdefghijkl",
- "versionNumber": 1,
- "versionCreated": "2022-01-01T12:00:00.000Z",
- "versionStatus": "Draft"
}, - "facts": {
- "global": [
- {
- "id": "WA:KF:abcdefgh-abcd-abcd-abcdefghijkl",
- "subject": {
- "concept": "Country",
- "value": "France",
- "dataType": "string"
}, - "relationship": "has language",
- "object": {
- "concept": "Language",
- "value": "French",
- "dataType": "string"
}, - "certainty": 100,
- "source": "knowledgemap"
}
], - "context": [ ],
- "local": [
- {
- "id": "WA:KF:abcdefgh-abcd-abcd-abcdefghijkl",
- "subject": {
- "concept": "Person",
- "value": "Mat",
- "dataType": "string"
}, - "relationship": "lives in",
- "object": {
- "concept": "Country",
- "value": "France",
- "dataType": "string"
}, - "certainty": 100,
- "source": "knowledgemap"
}
]
}
}