Skip to content

REST API

Gwendal Daniel edited this page Nov 14, 2019 · 5 revisions

Xatkit exposes information about a running bot through a REST API. This page details the different endpoints, expected parameters, and response examples.

Monitoring API

List Monitoring Data

Lists all the monitoring information. Note: this method does not support pagination yet (see this issue), so the response may be big for long-running applications.

Endpoint

GET /analytics/monitoring

Response

[
    {
        "sessionId": "72f8fa90-8d3e-4804-b00d-5612a95fb644",
        "entries": [
            {
                "timestamp": 1573750605388,
                "utterance": "How are you?",
                "intent": "HowAreYou",
                "confidence": 1.0
            },
            {
                "timestamp": 1573750623741,
                "utterance": "Here is something you won't understand!",
                "intent": "Default_Fallback_Intent",
                "confidence": 1.0
            },
            {
                "timestamp": 1573750630281,
                "utterance": "I knew it",
                "intent": "Default_Fallback_Intent",
                "confidence": 1.0
            }
        ],
        "matchedUtteranceCount": 1,
        "unmatchedUtteranceCount": 2
    }
]

Note: the timestamp fields contain timestamps in milliseconds.

List Session Data

Lists the monitoring information corresponding to the provided sessionId.

Endpoint

GET /analytics/monitoring/session?sessionId=id

Parameters

Name Type Description
sessionId string Mandatory: the identifier of the Xatkit session to retrieve the information from

Response

{
    "sessionId": "72f8fa90-8d3e-4804-b00d-5612a95fb644",
    "entries": [
        {
            "timestamp": 1573750605388,
            "utterance": "How are you?",
            "intent": "HowAreYou",
            "confidence": 1.0
        },
        {
            "timestamp": 1573750623741,
            "utterance": "Here is something you won't understand!",
            "intent": "Default_Fallback_Intent",
            "confidence": 1.0
        },
        {
            "timestamp": 1573750630281,
            "utterance": "I knew it",
            "intent": "Default_Fallback_Intent",
            "confidence": 1.0
        }
    ],
    "matchedUtteranceCount": 1,
    "unmatchedUtteranceCount": 2
}

Note: the timestamp fields contain timestamps in milliseconds.

List Unmatched Utterances

Lists all the user inputs that haven't been successfully translated into intents.

Endpoint

GET /analytics/monitoring/unmatched

Response

[
    {
        "sessionId": "72f8fa90-8d3e-4804-b00d-5612a95fb644",
        "timestamp": 1573750623741,
        "utterance": "Here is something you won't understand!"
    },
    {
        "sessionId": "72f8fa90-8d3e-4804-b00d-5612a95fb644",
        "timestamp": 1573750630281,
        "utterance": "I knew it"
    }
]

Note: the timestamp fields contain timestamps in milliseconds.

List Matched Utterances

Lists all the user inputs that have been successfully translated into intents.

Endpoint

GET /analytics/monitoring/matched

Response

[
    {
        "sessionId": "72f8fa90-8d3e-4804-b00d-5612a95fb644",
        "timestamp": 1573750605388,
        "utterance": "How are you?",
        "intent": "HowAreYou",
        "confidence": 1.0
    }
]

Note: the timestamp fields contain timestamps in milliseconds.

Get Sessions Stats

Returns a set of session-level statistics (e.g. average time/session, average number of matched inputs/session, etc).

Endpoint

GET /analytics/monitoring/sessions/stats

Response

{
    "averageMatchedUtteranceCount": 1.0,
    "averageUnmatchedUtteranceCount": 2.0,
    "averageSessionTime": 43.246
}

Note: the averageSessionTime field represents the average session time in seconds.

Clone this wiki locally