{"id":18059,"date":"2018-08-24T11:46:36","date_gmt":"2018-08-24T11:46:36","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?post_type=docs&#038;p=15185"},"modified":"2022-12-02T06:17:11","modified_gmt":"2022-12-02T06:17:11","slug":"find-intent-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/api-guide\/find-intent-api\/","title":{"rendered":"Find Intent API"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>To fetch the intent recognition result and the scores from NLP and ML engines.<\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>Method<\/strong><\/td>\n<td>POST<\/td>\n<\/tr>\n<tr>\n<td><strong>Endpoint<\/strong><\/td>\n<td><code>https:\/\/{{host}}\/api\/v1.1\/rest\/bot\/{{BotID}}\/findIntent?fetchConfiguredTasks=false<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Content Type<\/strong><\/td>\n<td><code>application\/json<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Authorization<\/strong><\/td>\n<td>\n<p><code>auth: {{JWT}}<\/code><\/p>\n<p>See <a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/api-guide\/apis\/#Generating_the_JWT_Token\" rel=\"noopener noreferrer\" target=\"_blank\">How to generate the JWT Token.<\/a><\/td>\n<\/tr>\n<tr>\n<td><strong>API Scope<\/strong><\/td>\n<td>\n<ul>\n<li>Bot Builder: Intent and Entity Detection<\/li>\n<li>Admin Console: Intent Identification > Intent and Entity Detection<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Path_Parameters\">Path Parameters<\/span><\/h2>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Required\/Optional<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>host<\/td>\n<td>Required<\/td>\n<td>Environment URL, for example, https:\/\/bots.kore.ai<\/td>\n<\/tr>\n<tr>\n<td>BotID<\/td>\n<td>Required<\/td>\n<td>Bot ID or Stream ID. You can access it from the General Settings page of the bot.<\/td>\n<\/tr>\n<tr>\n<td>fetchConfiguredTasks<\/td>\n<td>Required<\/td>\n<td><i>true <\/i>if you want to fetch the intents from configured tasks in the bot and <i>false <\/i>if you want to fetch only for the published tasks<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Bot_Language\">Bot Language<\/span><\/h3>\n<p>Optionally, if multi-language is enabled for the Bot, you need to pass the bot-language header with the language code such as 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.<\/p>\n<p><code>bot-header: {{lang-code}}<\/code><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Sample_Request\">Sample Request<\/span><\/h2>\n<pre>curl -X POST \\\r\n\u00a0 'https:\/\/{{host}}\/api\/v1.1\/rest\/bot\/{{BotID}}\/findIntent?fetchConfiguredTasks=false' \\\r\n\u00a0 -H \"Content-Type:application\/json\" \\\r\n  -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}'\\ \r\n  -H \"bot-language:{{lang-code}}\" \\\r\n  -d '{\r\n     \"parentIntent\": \"{{parent intent}}\",\r\n     \"input\": \"{{user utterance}}\",\r\n     \"streamName\": \"{{bot name}}\"\r\n   }'<\/pre>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Body_Parameters\">Body Parameters<\/span><\/h2>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Required\/Optional<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>parentIntent<\/td>\n<td>Optional<\/td>\n<td>To detect a sub-intent in the context of another intent<\/td>\n<\/tr>\n<tr>\n<td>input<\/td>\n<td>Required<\/td>\n<td>The user utterance to find the matching intents<br \/>Example: Create a task<\/td>\n<\/tr>\n<tr>\n<td>streamName<\/td>\n<td>Required<\/td>\n<td>The name of the bot<br \/>Example: JIRA Bot<\/td>\n<\/tr>\n<td>bot-language<\/td>\n<td>Optional<\/td>\n<td>The bot language, for example, \u201cen\u201d for English and \u201cde\u201d for German.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Sample_Response\">Sample Response<\/span><\/h2>\n<pre class=\"code-limit-400px\">{\r\n    \"request\": {\r\n        \"input\": \"book a ticket\",\r\n        \"streamName\": \"Public APIs\"\r\n    },\r\n    \"response\": {\r\n        \"usedtime\": 313,\r\n        \"debugTitle\": \"Intent Match Successful: 'Book a ticket'\",\r\n        \"result\": \"successintent\",\r\n        \"messageStoreId\": \"xxx\",\r\n        \"bot\": \"Public APIs\",\r\n        \"botid\": \"st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb\",\r\n        \"task\": \"Book a ticket\",\r\n        \"taskId\": \"dg-18219164-c11c-5605-9c29-d2e632ec3646\",\r\n        \"intentStatus\": \"published\",\r\n        \"subType\": \"dialog\",\r\n        \"input\": [\r\n            \"book a ticket\"\r\n        ],\r\n        \"identifiedVia\": \"cs em\",\r\n        \"language\": \"en\",\r\n        \"userId\": \"u-5dad2ccd-b271-5c00-a338-2e6e25e1ec91\",\r\n        \"time\": \"2019-06-27T11:48:28.250Z\",\r\n        \"_id\": \"f-19f149a6-25e3-5c85-8793-679bfd26acf5\",\r\n        \"traits\": {},\r\n        \"toneAnalysis\": {},\r\n        \"nlProcessing\": {\r\n            \"originalInput\": \"book a ticket\",\r\n            \"canonical\": \"book a ticket\",\r\n            \"wordAnalysis\": [\r\n                {\r\n                    \"word\": \"book\",\r\n                    \"ignored\": false,\r\n                    \"pos\": \"Verb_infinitive \",\r\n                    \"role\": \"MAINVERB \",\r\n                    \"original\": \"book\",\r\n                    \"processedWord\": \"book\"\r\n                },\r\n                {\r\n                    \"word\": \"a\",\r\n                    \"ignored\": true,\r\n                    \"pos\": \"Determiner \",\r\n                    \"original\": \"a\",\r\n                    \"processedWord\": \"a\"\r\n                },\r\n                {\r\n                    \"word\": \"ticket\",\r\n                    \"ignored\": false,\r\n                    \"pos\": \"Noun_singular \",\r\n                    \"role\": \"MAINOBJECT \",\r\n                    \"original\": \"ticket\",\r\n                    \"processedWord\": \"ticket\"\r\n                }\r\n            ]\r\n        },\r\n        \"ml\": {\r\n            \"namedEntityRecognition\": []\r\n        },\r\n        \"fm\": {\r\n            \"definitive\": [\r\n                {\r\n                    \"count\": 2,\r\n                    \"score\": 11643.33,\r\n                    \"botid\": \"st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb\",\r\n                    \"botname\": \"Public APIs\",\r\n                    \"activity\": \"Book a ticket\",\r\n                    \"activityType\": 1,\r\n                    \"exactcount\": 2,\r\n                    \"labelsize\": 2,\r\n                    \"ignorewords\": 1,\r\n                    \"mask\": 66306,\r\n                    \"words\": {\r\n                        \"book\": [\r\n                            \"0-1\"\r\n                        ],\r\n                        \"ticket\": [\r\n                            \"0-3\"\r\n                        ]\r\n                    },\r\n                    \"priority\": 2,\r\n                    \"tense\": 8192,\r\n                    \"mainRoles\": 10,\r\n                    \"sentencelength\": 3,\r\n                    \"ignorewordlist\": {\r\n                        \"a\": 1\r\n                    },\r\n                    \"maskEntity\": 66306,\r\n                    \"firstwordmatch\": \"book\",\r\n                    \"details\": {\r\n                        \"0\": {\r\n                            \"1\": {\r\n                                \"labelword\": \"book\",\r\n                                \"inputwords\": {\r\n                                    \"1\": \"book\"\r\n                                },\r\n                                \"wordindex\": [\r\n                                    1\r\n                                ],\r\n                                \"foundexact\": true,\r\n                                \"bestwordindex\": 1,\r\n                                \"role\": 2,\r\n                                \"pos\": 2200096997376,\r\n                                \"tense\": 8192,\r\n                                \"ageLevel\": 1,\r\n                                \"commonness\": 6\r\n                            },\r\n                            \"2\": {\r\n                                \"labelword\": \"ticket\",\r\n                                \"inputwords\": {\r\n                                    \"3\": \"ticket\"\r\n                                },\r\n                                \"wordindex\": [\r\n                                    3\r\n                                ],\r\n                                \"foundexact\": true,\r\n                                \"bestwordindex\": 3,\r\n                                \"role\": 8,\r\n                                \"pos\": 2147483680,\r\n                                \"tense\": 8192,\r\n                                \"ageLevel\": 1,\r\n                                \"commonness\": 5\r\n                            }\r\n                        }\r\n                    },\r\n                    \"hasNoun\": true,\r\n                    \"hasVerb\": true,\r\n                    \"ageLevel\": 1,\r\n                    \"foundFmEngine\": true,\r\n                    \"scoreBreakdown\": {\r\n                        \"wordMatch\": 500,\r\n                        \"exactWords\": 60,\r\n                        \"coverage\": 2000,\r\n                        \"sentenceBonus\": 4000,\r\n                        \"positionBonus\": 733.33,\r\n                        \"orderBonus\": 100,\r\n                        \"spreadBonus\": 800,\r\n                        \"roleBonus\": 2900,\r\n                        \"faqQuestionBonus\": 0,\r\n                        \"mlMatchBonus\": 0,\r\n                        \"tasktypeBonus\": 50,\r\n                        \"matchBonus\": 500,\r\n                        \"phraseJoinPenalty\": 0\r\n                    },\r\n                    \"matchType\": \"definite\",\r\n                    \"task\": \"Book a ticket\",\r\n                    \"state\": \"published\",\r\n                    \"foundVia\": \"wordMatch\"\r\n                }\r\n            ]\r\n        },\r\n        \"finalResolver\": {\r\n            \"ranking\": [\r\n                {\r\n                    \"taskId\": \"dg-18219164-c11c-5605-9c29-d2e632ec3646\",\r\n                    \"intent\": \"Book a ticket\",\r\n                    \"activityType\": \"dialog\",\r\n                    \"state\": \"published\",\r\n                    \"totalScore\": 11643.33,\r\n                    \"scoring\": {\r\n                        \"count\": 2,\r\n                        \"score\": 11643.33,\r\n                        \"botid\": \"st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb\",\r\n                        \"botname\": \"Public APIs\",\r\n                        \"activity\": \"Book a ticket\",\r\n                        \"activityType\": 1,\r\n                        \"exactcount\": 2,\r\n                        \"labelsize\": 2,\r\n                        \"ignorewords\": 1,\r\n                        \"mask\": 66306,\r\n                        \"words\": {\r\n                            \"book\": [\r\n                                \"0-1\"\r\n                            ],\r\n                            \"ticket\": [\r\n                                \"0-3\"\r\n                            ]\r\n                        },\r\n                        \"priority\": 10,\r\n                        \"tense\": 8192,\r\n                        \"mainRoles\": 10,\r\n                        \"sentencelength\": 3,\r\n                        \"ignorewordlist\": {\r\n                            \"a\": 1\r\n                        },\r\n                        \"maskEntity\": 66306,\r\n                        \"firstwordmatch\": \"book\",\r\n                        \"details\": {\r\n                            \"0\": {\r\n                                \"1\": {\r\n                                    \"labelword\": \"book\",\r\n                                    \"inputwords\": {\r\n                                        \"1\": \"book\"\r\n                                    },\r\n                                    \"wordindex\": [\r\n                                        1\r\n                                    ],\r\n                                    \"foundexact\": true,\r\n                                    \"bestwordindex\": 1,\r\n                                    \"role\": 2,\r\n                                    \"pos\": 2200096997376,\r\n                                    \"tense\": 8192,\r\n                                    \"ageLevel\": 1,\r\n                                    \"commonness\": 6\r\n                                },\r\n                                \"2\": {\r\n                                    \"labelword\": \"ticket\",\r\n                                    \"inputwords\": {\r\n                                        \"3\": \"ticket\"\r\n                                    },\r\n                                    \"wordindex\": [\r\n                                        3\r\n                                    ],\r\n                                    \"foundexact\": true,\r\n                                    \"bestwordindex\": 3,\r\n                                    \"role\": 8,\r\n                                    \"pos\": 2147483680,\r\n                                    \"tense\": 8192,\r\n                                    \"ageLevel\": 1,\r\n                                    \"commonness\": 5\r\n                                }\r\n                            }\r\n                        },\r\n                        \"hasNoun\": true,\r\n                        \"hasVerb\": true,\r\n                        \"ageLevel\": 1,\r\n                        \"foundFmEngine\": true,\r\n                        \"scoreBreakdown\": {\r\n                            \"wordMatch\": 500,\r\n                            \"exactWords\": 60,\r\n                            \"coverage\": 2000,\r\n                            \"sentenceBonus\": 4000,\r\n                            \"positionBonus\": 733.33,\r\n                            \"orderBonus\": 100,\r\n                            \"spreadBonus\": 800,\r\n                            \"roleBonus\": 2900,\r\n                            \"faqQuestionBonus\": 0,\r\n                            \"mlMatchBonus\": 0,\r\n                            \"tasktypeBonus\": 50,\r\n                            \"matchBonus\": 500,\r\n                            \"phraseJoinPenalty\": 0\r\n                        },\r\n                        \"matchType\": \"definite\",\r\n                        \"csMatch\": true\r\n                    },\r\n                    \"identifyingEngines\": {\r\n                        \"fm\": true\r\n                    },\r\n                    \"csMatch\": true,\r\n                    \"intentMatchVia\": \"wordMatch\"\r\n                }\r\n            ],\r\n            \"userInput\": \"book a ticket\",\r\n            \"winningIntent\": [\r\n                {\r\n                    \"intent\": \"Book a ticket\",\r\n                    \"taskId\": \"dg-18219164-c11c-5605-9c29-d2e632ec3646\",\r\n                    \"activityType\": \"dialog\",\r\n                    \"state\": \"published\",\r\n                    \"score\": 11643.33\r\n                }\r\n            ],\r\n            \"entities\": []\r\n        }\r\n    },\r\n    \"streamId\": \"st-6ecb5ba2-5e31-5a40-b918-8cbee40f3fdb\",\r\n    \"streamName\": \"Public APIs\",\r\n    \"seqLogId\": \"f-19f149a6-25e3-5c85-8793-679bfd26acf5\",\r\n    \"_id\": \"f-19f149a6-25e3-5c85-8793-679bfd26acf5\",\r\n    \"name\": \"Public APIs\",\r\n    \"input\": [\r\n        \"book a ticket\"\r\n    ]\r\n}\r\n<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"To fetch the intent recognition result and the scores from NLP and ML engines. Method POST Endpoint https:\/\/{{host}}\/api\/v1.1\/rest\/bot\/{{BotID}}\/findIntent?fetchConfiguredTasks=false Content Type application\/json Authorization auth: {{JWT}} See How to generate the JWT Token. API Scope Bot Builder: Intent and Entity Detection Admin Console: Intent Identification > Intent and Entity Detection &nbsp; Path Parameters Parameter Required\/Optional Description host...","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-18059","post","type-post","status-publish","format-standard","hentry","category-api-guide"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/18059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=18059"}],"version-history":[{"count":36,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/18059\/revisions"}],"predecessor-version":[{"id":61383,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/18059\/revisions\/61383"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=18059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=18059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=18059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}