To extract the metrics data related to the intent detection and task performance using API. It can be used to retrieve metrics information related to Intents Found, Intents not Found, Failed Tasks, Successful Tasks, and Performance Logs
To use this API, the app needs the Bot Scope of Metrics.
POST https://{{host}}/api/public/bot/{{BotID}}/getAnalytics
Path Parameters
Parameter | Required/Optional | Description |
---|---|---|
host | Required | Environment URL, for example, https://bots.kore.ai |
BotID | Required | Bot ID or Stream ID. You can access it from the General Settings page of the bot. |
Body Parameters
Parameter | Required/Optional | Description |
---|---|---|
type | Required |
The type of metrics requested can be:
|
filters | Required | Object with the following details to filter the result set |
from | Required | The start timestamp from which the records need to be considered. |
to | Required | The end timestamp from which the records need to be considered. |
limit | Required | Number of records to be fetched. |
channel | Optional | The channels to be considered for the metrics. |
channelUIds | Optional | The user ids (channel specified) to be included in the metrics. |
isAmbiguous | Optional | whether to include ambiguous intents or not – set to true or false |
isDeveloper | Optional | whether to include developer metrics – set to true or false. |
trained | Optional | whether to include trained intents or not – set to true or false. |
taskId | Optional | To filter based on the task ids. |
userId | Optional | To filter based on user id. |
tags | Optional | To filter based on custom tags. Usage: "tags": { "and": [ { "name": "user", "values": ["uservalue"], "type": "user" }, { "name": "message", "values": ["mvalue"], "type": "message" } ] } |
sort | Optional | To sort the results. Usage: "sort": { "order": "<desc/asc>", "by": "<column name>" } |
skip | Optional | Number of records to be skipped from the result set. |
Authorization
Invoke the API with JWT in the header with the following syntax:
auth: {{JWT}}
Response Content Type
application/json
Sample Request
curl -X POST \ https://{{host}}/api/public/bot/{{bot_id}}/getAnalytics \ -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \ -H 'content-type: application/json' \ -d '{ "type": "successintent", "filters": { "from": "2020-08-11T17:25:09.698Z", "to": "2020-08-21T17:25:09.698Z", "tags": { "and": [ { "name": "us2", "values": [ "ss" ], "type": "user" } ] }, "channel": [ "rtm" ], "channelUIds": [ "test@kore.xyz" ], "isAmbiguous": false, "isDeveloper": true, "trained": false, "taskId": [ "dg-xxxx" ], "userId": [ "u-5e4xxx85-f12e-53e2-929e-01xx7156xxx8" ] }, "limit": 50 }'
Sample Response
{ "moreAvailable": true, "totalCount": 49, "result": [ { "messageId": "ms-439aa365-5240-52bf-ad10-bb0ef7b0d3c2", "utterance": "newTask", "intent": "newTask", "userId": "u-5e4xxx85-f12e-53e2-929e-01xx7156xxx8", "channelUId": "test@kore.xyz", "language": "en", "timestamp": "2020-08-20T18:49:19.877Z", "pinned": false, "channel": "rtm", "taskName": "newTask", "customTags": { "userTags": { "name": "us2", "value": "ss" }, "sessionTags": [], "messageTags": [] }, "NLAnalysis": {} }, { "messageId": "ms-2cc0b4aa-2f95-5524-8b7b-2442929b3cf5", "utterance": "newTask", "intent": "newTask", "userId": "u-5e4xxx85-f12e-53e2-929e-01xx7156xxx8", "channelUId": "test@kore.xyz", "language": "en", "timestamp": "2020-08-20T18:49:14.237Z", "pinned": false, "channel": "rtm", "taskName": "newTask", "customTags": { "userTags": { "name": "us2", "value": "ss" }, "sessionTags": [], "messageTags": [] }, "NLAnalysis": {} } ] }