Chatbot Overview
Conversational Bots
Intents & Entities
Intelligent Bots
Kore.ai's Approach
Kore.ai Conversational Platform
Bot Concepts and Terminology
Natural Language Processing (NLP)
Bot Types
Bot Tasks
Starting with Kore.ai Platform
How to Access Bot Builder
Working with Kore.ai Bot Builder
Building your first Bot
Getting Started with Building Bots
Using the Dialog Builder Tool
Creating a Simple Bot
Release Notes
Latest Updates
Older Releases
Bot Builder
Creating a Bot
Design
Develop
Storyboard
Dialog Task
User Intent Node
Dialog Node
Entity Node
Supported Entity Types
Composite Entities
Supported Time Zones
Supported Colors
Supported Company Names
Message Nodes
Confirmation Nodes
Service Node
Custom Authentication
2-way SSL for Service nodes
Script Node
Agent Transfer Node
WebHook Node
Connections & Transitions
Managing Dialogs
Prompt Editor
Alert Tasks
Alert Tasks
Ignore Words and Field Memory
Digital Views
Knowledge Graph
Terminology
Building
Generation
Importing and Exporting
Analysis
Knowledge Extraction
Small Talk
Action & Information Task
Action Tasks
Information Tasks
Establishing Flows
Natural Language
Overview
Machine Learning
ML Model
Fundamental Meaning
NLP Settings and Guidelines
Knowledge Graph Training
Traits
Ranking and Resolver
NLP Detection
Bot Intelligence
Overview
Context Management
Session and Context Variables
Context Object
Dialog Management
Sub-Intents
Amend Entity
Multi-Intent Detection
Sentiment Management
Tone Analysis
Sentiment Management
Default Conversations
Default Standard Responses
Channel Enablement
Test & Debug
Talk to Bot
Utterance Testing
Batch Testing
Record Conversations
Publishing your Bot
Analyzing your Bot
Overview
Dashboard
Custom Dashboard
Conversation Flows
Bot Metrics
Advanced Topics
Bot Authorization
Language Management
Collaborative Development
IVR Integration
koreUtil Libraries
Universal Bots
Defining
Creating
Customizing
Enabling Languages
Smart Bots
Defining
Sample Bots
Github
Asana
Travel Planning
Flight Search
Event Based Bot Actions
Bot Settings
Bot Functions
General Settings
PII Settings
Customizing Error Messages
Bot Management
Using Bot Variables
API Guide
API Overview
API List
API Collection
SDKs
SDK Overview
SDK Security
SDK App Registration
Web SDK Tutorial
Message Formatting and Templates
Mobile SDK Push Notification
Widget SDK Tutorial
Widget SDK – Message Formatting and Templates
Web Socket Connect & RTM
Using the BotKit SDK
Installing
Configuring
Events
Functions
BotKit SDK Tutorial – Agent Transfer
BotKit SDK Tutorial – Flight Search Sample Bot
Using an External NLP Engine
Bot Administration
Bots Admin Console
Dashboard
User Management
Managing Users
Managing Groups
Managing Role
Bots Management
Enrollment
Inviting Users
Bulk Invites
Importing Users
Synchronizing Users from AD
Security & Compliance
Using Single Sign-On
Security Settings
Cloud Connector
Analytics
Billing
How Tos
Creating a Simple Bot
Creating a Banking Bot
Transfer Funds Task
Update Balance Task
Context Switching
Using Traits
Schedule a Smart Alert
Configuring Digital Views
Custom Dashboard
Custom Tags to filter Bot Metrics
Patterns for Intents & Entities
Build Knowledge Graph
Global Variables
Content Variables
Using Bot Functions
Configure Agent Transfer
  1. Home
  2. Docs
  3. Bots
  4. API Guide
  5. Find Intent API

Find Intent API

Fetches the intent recognition result and the scoring from NLP and ML engines.

To use this API, app needs the Bot Builder API scope of Intent and Entity Detection.

POST https://{{host}}/api/v1.1/rest/streams/{{BotID}}/findIntent?fetchConfiguredTasks=false

Query Parameters

Parameter Description
host Environment URL, for example, https://bots.kore.ai
BotID Bot ID. You can access it from the General Settings page of the bot.
fetchConfiguredTasks true if you want to fetch the intents from configured tasks in the bot and false if you want to fetch only for the published tasks

Body Parameters

Parameter Description
input The user utterance to find the matching intents
Example: Create a task
streamName Name of the bot
Example: JIRA Bot

Authorization

Invoke the API with JWT in the header with the following syntax:

auth: {{JWT}}

Bot Language

Optionally, if multi-language is enabled for the Bot, you need to pass the bot-language header with the language code, eg en, zh_cn etc.. If the language code is not passed for a multi-lingual Bot, then the default language of the Bot will be considered.

bot-header: {{lang-code}}

Response content type

application/json

Sample Request

curl -X POST \
  'https://{{host}}/api/v1.1/rest/streams/{{BotID}}/findIntent?fetchConfiguredTasks=false' \
  -H "Content-Type:application/json" \
  -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}'\ 
  -H "bot-language:{{lang-code}}" \
  -d '{
  "input": "{{user utterance}}",
  "streamName": "{{bot name}}"
}'

Sample Response

{
    "request": {
        "input": "book a ticket",
        "streamName": "Public APIs"
    },
    "response": {
        "usedtime": 313,
        "debugTitle": "Intent Match Successful: 'Book a ticket'",
        "result": "successintent",
        "messageStoreId": "xxx",
        "bot": "Public APIs",
        "botid": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb",
        "task": "Book a ticket",
        "taskId": "dg-18219164-c11c-5605-9c29-d2e632ec3646",
        "intentStatus": "published",
        "subType": "dialog",
        "input": [
            "book a ticket"
        ],
        "identifiedVia": "cs em",
        "language": "en",
        "userId": "u-5dad2ccd-b271-5c00-a338-2e6e25e1ec91",
        "time": "2019-06-27T11:48:28.250Z",
        "_id": "f-19f149a6-25e3-5c85-8793-679bfd26acf5",
        "traits": {},
        "toneAnalysis": {},
        "nlProcessing": {
            "originalInput": "book a ticket",
            "canonical": "book a ticket",
            "wordAnalysis": [
                {
                    "word": "book",
                    "ignored": false,
                    "pos": "Verb_infinitive ",
                    "role": "MAINVERB ",
                    "original": "book",
                    "processedWord": "book"
                },
                {
                    "word": "a",
                    "ignored": true,
                    "pos": "Determiner ",
                    "original": "a",
                    "processedWord": "a"
                },
                {
                    "word": "ticket",
                    "ignored": false,
                    "pos": "Noun_singular ",
                    "role": "MAINOBJECT ",
                    "original": "ticket",
                    "processedWord": "ticket"
                }
            ]
        },
        "ml": {
            "namedEntityRecognition": []
        },
        "fm": {
            "definitive": [
                {
                    "count": 2,
                    "score": 11643.33,
                    "botid": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb",
                    "botname": "Public APIs",
                    "activity": "Book a ticket",
                    "activityType": 1,
                    "exactcount": 2,
                    "labelsize": 2,
                    "ignorewords": 1,
                    "mask": 66306,
                    "words": {
                        "book": [
                            "0-1"
                        ],
                        "ticket": [
                            "0-3"
                        ]
                    },
                    "priority": 2,
                    "tense": 8192,
                    "mainRoles": 10,
                    "sentencelength": 3,
                    "ignorewordlist": {
                        "a": 1
                    },
                    "maskEntity": 66306,
                    "firstwordmatch": "book",
                    "details": {
                        "0": {
                            "1": {
                                "labelword": "book",
                                "inputwords": {
                                    "1": "book"
                                },
                                "wordindex": [
                                    1
                                ],
                                "foundexact": true,
                                "bestwordindex": 1,
                                "role": 2,
                                "pos": 2200096997376,
                                "tense": 8192,
                                "ageLevel": 1,
                                "commonness": 6
                            },
                            "2": {
                                "labelword": "ticket",
                                "inputwords": {
                                    "3": "ticket"
                                },
                                "wordindex": [
                                    3
                                ],
                                "foundexact": true,
                                "bestwordindex": 3,
                                "role": 8,
                                "pos": 2147483680,
                                "tense": 8192,
                                "ageLevel": 1,
                                "commonness": 5
                            }
                        }
                    },
                    "hasNoun": true,
                    "hasVerb": true,
                    "ageLevel": 1,
                    "foundFmEngine": true,
                    "scoreBreakdown": {
                        "wordMatch": 500,
                        "exactWords": 60,
                        "coverage": 2000,
                        "sentenceBonus": 4000,
                        "positionBonus": 733.33,
                        "orderBonus": 100,
                        "spreadBonus": 800,
                        "roleBonus": 2900,
                        "faqQuestionBonus": 0,
                        "mlMatchBonus": 0,
                        "tasktypeBonus": 50,
                        "matchBonus": 500,
                        "phraseJoinPenalty": 0
                    },
                    "matchType": "definite",
                    "task": "Book a ticket",
                    "state": "published",
                    "foundVia": "wordMatch"
                }
            ]
        },
        "finalResolver": {
            "ranking": [
                {
                    "taskId": "dg-18219164-c11c-5605-9c29-d2e632ec3646",
                    "intent": "Book a ticket",
                    "activityType": "dialog",
                    "state": "published",
                    "totalScore": 11643.33,
                    "scoring": {
                        "count": 2,
                        "score": 11643.33,
                        "botid": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb",
                        "botname": "Public APIs",
                        "activity": "Book a ticket",
                        "activityType": 1,
                        "exactcount": 2,
                        "labelsize": 2,
                        "ignorewords": 1,
                        "mask": 66306,
                        "words": {
                            "book": [
                                "0-1"
                            ],
                            "ticket": [
                                "0-3"
                            ]
                        },
                        "priority": 10,
                        "tense": 8192,
                        "mainRoles": 10,
                        "sentencelength": 3,
                        "ignorewordlist": {
                            "a": 1
                        },
                        "maskEntity": 66306,
                        "firstwordmatch": "book",
                        "details": {
                            "0": {
                                "1": {
                                    "labelword": "book",
                                    "inputwords": {
                                        "1": "book"
                                    },
                                    "wordindex": [
                                        1
                                    ],
                                    "foundexact": true,
                                    "bestwordindex": 1,
                                    "role": 2,
                                    "pos": 2200096997376,
                                    "tense": 8192,
                                    "ageLevel": 1,
                                    "commonness": 6
                                },
                                "2": {
                                    "labelword": "ticket",
                                    "inputwords": {
                                        "3": "ticket"
                                    },
                                    "wordindex": [
                                        3
                                    ],
                                    "foundexact": true,
                                    "bestwordindex": 3,
                                    "role": 8,
                                    "pos": 2147483680,
                                    "tense": 8192,
                                    "ageLevel": 1,
                                    "commonness": 5
                                }
                            }
                        },
                        "hasNoun": true,
                        "hasVerb": true,
                        "ageLevel": 1,
                        "foundFmEngine": true,
                        "scoreBreakdown": {
                            "wordMatch": 500,
                            "exactWords": 60,
                            "coverage": 2000,
                            "sentenceBonus": 4000,
                            "positionBonus": 733.33,
                            "orderBonus": 100,
                            "spreadBonus": 800,
                            "roleBonus": 2900,
                            "faqQuestionBonus": 0,
                            "mlMatchBonus": 0,
                            "tasktypeBonus": 50,
                            "matchBonus": 500,
                            "phraseJoinPenalty": 0
                        },
                        "matchType": "definite",
                        "csMatch": true
                    },
                    "identifyingEngines": {
                        "fm": true
                    },
                    "csMatch": true,
                    "intentMatchVia": "wordMatch"
                }
            ],
            "userInput": "book a ticket",
            "winningIntent": [
                {
                    "intent": "Book a ticket",
                    "taskId": "dg-18219164-c11c-5605-9c29-d2e632ec3646",
                    "activityType": "dialog",
                    "state": "published",
                    "score": 11643.33
                }
            ],
            "entities": []
        }
    },
    "streamId": "st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb",
    "streamName": "Public APIs",
    "seqLogId": "f-19f149a6-25e3-5c85-8793-679bfd26acf5",
    "_id": "f-19f149a6-25e3-5c85-8793-679bfd26acf5",
    "name": "Public APIs",
    "input": [
        "book a ticket"
    ]
}
Menu