{"id":18059,"date":"2018-08-24T11:46:36","date_gmt":"2018-08-24T11:46:36","guid":{"rendered":"https:\/\/developer.kore.ai\/v8-1\/?post_type=docs&#038;p=15185"},"modified":"2021-05-31T09:37:39","modified_gmt":"2021-05-31T08:37:39","slug":"find-intent-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v8-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>Fetches the intent recognition result and the scoring from NLP and ML engines.<\/p>\n<p class=\"note\">To use this API, app needs the Bot Builder API scope of <em>Intent and Entity Detection<\/em>.<\/p>\n<p><b>POST<\/b> <code>https:\/\/{{host}}\/api\/v1.1\/rest\/streams\/{{BotID}}\/findIntent?fetchConfiguredTasks=false<\/code><\/p>\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>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Query_Parameters\">Query Parameters<\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>host<\/td>\n<td>Environment URL, for example, https:\/\/bots.kore.ai<\/td>\n<\/tr>\n<tr>\n<td>BotID<\/td>\n<td>Bot ID. You can access it from the General Settings page of the bot.<\/td>\n<\/tr>\n<tr>\n<td>fetchConfiguredTasks<\/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\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>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Body_Parameters\">Body Parameters<\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>parentIntent<\/td>\n<td>To support Multiple Intent Models<\/td>\n<\/tr>\n<tr>\n<td>input<\/td>\n<td>The user utterance to find the matching intents<br \/>Example: Create a task<br \/>\nNote: Utterances greater than 3,000 characters in length are not allowed<\/td>\n<\/tr>\n<tr>\n<td>streamName<\/td>\n<td>Name of the bot<br \/>Example: JIRA Bot<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\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>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Authorization\">Authorization<\/span><\/h3>\n<p>Invoke the API with JWT in the header with the following syntax:<\/p>\n<p><code>auth: {{JWT}}<\/code><\/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, 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.<\/p>\n<p><code>bot-header: {{lang-code}}<\/code><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Response_content_type\">Response content type<\/span><\/h3>\n<p><code>application\/json<\/code><\/p>\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>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Sample_Request\">Sample Request<\/span><\/h3>\n<pre>curl -X POST \\\r\n\u00a0 'https:\/\/{{host}}\/api\/v1.1\/rest\/streams\/{{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\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>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Sample_Response\">Sample Response<\/span><\/h3>\n<pre>{\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":"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...","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\/v8-1\/wp-json\/wp\/v2\/posts\/18059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/comments?post=18059"}],"version-history":[{"count":9,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/18059\/revisions"}],"predecessor-version":[{"id":27487,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/18059\/revisions\/27487"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/media?parent=18059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/categories?post=18059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/tags?post=18059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}