{"id":18089,"date":"2018-12-04T13:58:10","date_gmt":"2018-12-04T13:58:10","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?post_type=docs&#038;p=15683"},"modified":"2022-11-30T15:42:39","modified_gmt":"2022-11-30T15:42:39","slug":"import-bot-as-a-new-bot-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/api-guide\/import-bot-as-a-new-bot-api\/","title":{"rendered":"Import Bot as a New 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\"><div class=\"w-separator size_medium\"><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>To create a new bot in the account owner\u2019s Builder Tool using the <i>File IDs<\/i> generated when uploading the files to the local server.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-message color_blue\"><div class=\"w-message-body\"><p>Please refer to the <a href=\"\/docs\/bots\/api-guide\/upload-file-api\/\" target=\"_blank\" rel=\"noopener noreferrer\">Upload File API<\/a> for uploading and obtaining the <b><i>File Id<\/i><\/b>.<\/p>\n<\/p><\/div><\/div>\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<p><b>Note<\/b>: The API requires the JWT generated by an application created only from 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\/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>Description<\/th>\n<th>Mandate<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">host<\/span><\/td>\n<td>The environment URL. For example, <code>https:\/\/bots.kore.ai<\/code><\/td>\n<td>Required<\/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\">Sample Request<\/span><\/h2>\n<pre>curl -X POST \\\r\n  https:\/\/{{host}}\/api\/public\/bot\/import \\\r\n  -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \\\r\n   -H 'content-type: application\/json' \\\r\n   -d '{\r\n  \"botDefinition\" : \"5bxxxxxxxxxxx4f9\",\r\n  \"configInfo\" : \"5bxxxxxxxxxxxxx4fa\",\r\n  \"botFunctions\":[\"5bxxxxxxxxxxxxxea6\"],\r\n  \"icon\":\"5bxxxxxxxxxxxxxxxx4fb\"\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>Description<\/th>\n<th>Mandate<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><b>botDefinition<\/b><\/td>\n<td>\u201cBot definition file id\u201d<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td><b>configInfo<\/b><\/td>\n<td>\u201cBot configuration file id\u201d<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td><b>botFunctions<\/b><\/td>\n<td>\u201cBot functions File id\u201d<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td><b>icon<\/b><\/td>\n<td>\u201cBot icon File id\u201d<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td><b>name<\/b><\/td>\n<td>\u201cBot name\u201d<br \/>&#8211; If not provided, it is fetched from the existing bot&#8217;s copy.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td><b>purpose<\/b><\/td>\n<td>\u201ccustomer\u201d\/\u201demployee\u201d<br \/>&#8211; If not provided, it is fetched from the existing bot&#8217;s copy.<\/td>\n<td>Optional<\/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_Response\">Sample Response<\/span><\/h2>\n<pre>{\r\n    \"status\": \"pending\",\r\n    \"\"streamId\": \"st-xxxxx-xxx-xxx-xxx-xxxxx\",\r\n    \"statusLogs\": [\r\n        {\r\n            \"taskType\": \"importRequest\",\r\n            \"taskName\": \"Welcome\",\r\n            \"status\": \"success\"\r\n        }\r\n    ],\r\n    \"createdBy\": \"u-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx\",\r\n    \"requestType\": \"Botimport\",\r\n    \"bir\": \"bir-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\r\n    \"createdOn\": \"2022-07-29T07:24:17.496Z\",\r\n    \"__v\": 0\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><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\"><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"To create a new bot in the account owner\u2019s Builder Tool using the File IDs generated when uploading the files to the local server. Please refer to the Upload File API for uploading and obtaining the File Id. &nbsp; Note: The API requires the JWT generated by an application created only from the Bot Admin...","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-18089","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\/18089","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=18089"}],"version-history":[{"count":34,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/18089\/revisions"}],"predecessor-version":[{"id":49364,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/18089\/revisions\/49364"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=18089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=18089"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=18089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}