{"id":18090,"date":"2018-12-04T13:59:33","date_gmt":"2018-12-04T13:59:33","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?post_type=docs&#038;p=15687"},"modified":"2022-11-30T15:47:58","modified_gmt":"2022-11-30T15:47:58","slug":"import-bot-into-an-existing-bot-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/api-guide\/import-bot-into-an-existing-bot-api\/","title":{"rendered":"Import Bot into an Existing Bot 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 import the bot definition file to an existing bot for a current version upgrade or previous version restoration.<\/p>\n<p><b>Note<\/b>: This API requires the JWT generated by an application created on the <b>Bot Admin Console<\/b>.<\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Method<\/b><\/td>\n<td>POST<\/td>\n<\/tr>\n<tr>\n<td><b>Endpoint<\/b><\/td>\n<td><span style=\"font-weight: 400\"><code>https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/import<\/code><\/span><\/td>\n<\/tr>\n<tr>\n<td><b>Content Type<\/b><\/td>\n<td><code>application\/json<\/code><\/td>\n<\/tr>\n<tr>\n<td><b>Authorization<\/b><\/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><b>API Scope<\/b><\/td>\n<td>\n<ul>\n<li>Bot Builder: Not Applicable<\/li>\n<li>Admin Console: Bot Definition > Bot Import<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Query_Parameters\">Query Parameters<\/span><\/h2>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Mandate<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\"><b>host<\/b><\/span><\/td>\n<td>Required<\/td>\n<td>The environment URL. For example, <code>https:\/\/bots.kore.ai<\/code><\/td>\n<\/tr>\n<tr>\n<td><b>BotID<\/b><\/td>\n<td>Required<\/td>\n<td><span style=\"font-weight: 400\">The <i>Bot ID<\/i> or <i>Stream ID<\/i>. You can access it under <b>General Settings<\/b> on the Bot Builder.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Sample_Request_for_the_Universal_Bot\">Sample Request for the Universal Bot<\/span><\/h2>\n<pre class=\"code-limit-400px\">curl -X POST \\\r\n  https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/import \\\r\n  -H 'auth: YOUR_JWT_ACCESS_TOKEN' \\\r\n  -H 'content-type: application\/json' \\\r\n  -d '{\r\n  \"botDefinition\" : \"5bxxxxxxxxxxxxxxxxxxxxxx\",\r\n  \"configInfo\" : \"5bxxxxxxxxxxxxxxxxxxxxxx\",\r\n  \"importOptions\": {\r\n\t\"nlpData\": [\r\n\t\t\"training_data\",\r\n\t\t\"bot_synonyms\",\r\n\t\t\"nlpSettings\",\r\n\t\t\"defaultDialog\",\r\n\t\t\"standardResponses\"\r\n\t],\r\n\t\"settings\": [\r\n\t\t\"botSettings\",\r\n\t\t\"ivrSettings\",\r\n\t\t\"botVariables\",\r\n\t\t\"ivrSettings\"\r\n\t],\r\n\t\"options\": {\r\n\t\t\"utterances\": {\r\n\t\t\"append\": true,\r\n\t\t\"replace\": false\r\n\t\t}\r\n\t},\r\n\t\"botComponents\": [\r\n\t\t\"linkedBots\",\r\n\t\t\"smallTalk\"\r\n\t],\r\n\t\"customDashboard\": true\r\n}\r\n}'<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Sample_Request\">Sample Request<\/span><\/h2>\n<pre>curl -X POST \\\r\n  https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/import \\\r\n  -H 'auth: YOUR_JWT_ACCESS_TOKEN' \\\r\n  -H 'content-type: application\/json' \\\r\n  -d '{\r\n  \"botDefinition\" : \"5bxxxxxxxxxxxxxxxxxxxxxx\",\r\n  \"configInfo\" : \"5bxxxxxxxxxxxxxxxxxxxxxx\",\r\n  \"botFunctions\":[\"5bxxxxxxxxxxxxxxxxxxxxxx\"]\r\n}'<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<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>Mandate<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><b>botDefinition<\/b><\/td>\n<td>Required<\/td>\n<td>\u201cBot Definition File id\u201d <a href=\"\/docs\/bots\/api-guide\/upload-file-api\/\" rel=\"noopener noreferrer\" target=\"_blank\">Learn more <\/a>on obtaining the Definition <i>file ID<\/i>.<\/td>\n<\/tr>\n<tr>\n<td><b>configInfo<\/b><\/td>\n<td>Required<\/td>\n<td>\u201cBot Configuration File id\u201d <a href=\"\/docs\/bots\/api-guide\/upload-file-api\/\" rel=\"noopener noreferrer\" target=\"_blank\">Learn more <\/a>on obtaining the Configuration <i>file ID<\/i>.<\/td>\n<\/tr>\n<tr>\n<td><b>botFunctions<\/b><\/td>\n<td>Optional<\/td>\n<td>\u201cFileid\u201d<\/td>\n<\/tr>\n<tr>\n<td><b>importOptions<\/b><\/td>\n<td>Required<\/td>\n<td>\n<p>All bot components are imported by default. If needed, you may specify the components to be included in the import.<\/p>\n<p>Usage:<\/p>\n<pre>\"importOptions\": {\r\n   \"tasks\": [\r\n     \"botTask\",\r\n     \"knowledgeGraph\"\r\n     ],\r\n   \"nlpData\": [\r\n     \"nlpSettings\",\r\n     \"utterances\",\r\n     \"standardResponses\"\r\n     ],\r\n   \"settings\": [\r\n     \"botSettings\",\r\n     \"botVariables\",\r\n     \"ivrSettings\"\r\n     ]\r\n },<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td><b>options<\/b><\/td>\n<td>Optional<\/td>\n<td>\n<p>This will indicate incremental import options for the ML utterances, whether to replace or append. <a href=\"\/docs\/bots\/bot-settings\/bot-management\/bot-management-2\/#Steps_in_Importing_to_an_Existing_Bot\" target=\"_blank\" rel=\"noopener noreferrer\">Learn more<\/a>.<\/p>\n<p>Usage:<\/p>\n<pre>\"options\": {\r\n     \"utterances\": {\r\n        \"replace\": true\r\n\t\"append\":false\r\n        }\r\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p><strong>Universal Bot<\/strong><br \/>For the Universal bot, the <i>import<\/i> the <i>importOptions<\/i> may differ as shown below:<\/p>\n<pre class=\"code-limit-400px\">\"importOptions\": {\r\n\t\"nlpData\": [\r\n\t\t\"training_data\",\r\n\t\t\"bot_synonyms\",\r\n\t\t\"nlpSettings\",\r\n\t\t\"defaultDialog\",\r\n\t\t\"standardResponses\"\r\n\t],\r\n\t\"settings\": [\r\n\t\t\"botSettings\",\r\n\t\t\"ivrSettings\",\r\n\t\t\"botVariables\",\r\n\t\t\"ivrSettings\"\r\n\t],\r\n\t\"options\": {\r\n\t\t\"utterances\": {\r\n\t\t\"append\": true,\r\n\t\t\"replace\": false\r\n\t\t}\r\n\t},\r\n\t\"botComponents\": [\r\n\t\t\"linkedBots\",\r\n\t\t\"smallTalk\"\r\n\t],\r\n\t\"customDashboard\": true\r\n}<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Sample_Response\">Sample Response<\/span><\/h2>\n<pre>{\r\n    \"streamRefId\": \"c685t327-xxxx-58xx-9xbx-33xxxxxxxxxx\",\r\n    \"statusLogs\": [\r\n        {\r\n            \"taskType\": \"importRequest\",\r\n            \"taskName\": \"Sample Task\",\r\n            \"status\": \"success\"\r\n        }\r\n    ],\r\n    \"createdBy\": \"u-3xxxxxxx-axxe-5bxx-bxxb-8xxxxxxxxxxx\",\r\n    \"requestType\": \"Botimport\",\r\n    \"_id\": \"bir-00bxxxxx-7xx2-5xxx-bxxx-79xxxxxxxxxx\",\r\n    \"status\": \"pending\",\r\n    \"createdOn\": \"2018-12-05T07:40:51.956Z\",\r\n    \"__v\": 0\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 import the bot definition file to an existing bot for a current version upgrade or previous version restoration. Note: This API requires the JWT generated by an application created on the Bot Admin Console. &nbsp; Method POST Endpoint https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/import Content Type application\/json Authorization auth: {{JWT}} See How to generate the JWT Token. API Scope...","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-18090","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\/18090","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=18090"}],"version-history":[{"count":31,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/18090\/revisions"}],"predecessor-version":[{"id":49366,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/18090\/revisions\/49366"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=18090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=18090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=18090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}