{"id":18086,"date":"2018-12-04T13:55:30","date_gmt":"2018-12-04T13:55:30","guid":{"rendered":"https:\/\/developer.kore.ai\/v10\/?post_type=docs&#038;p=15663"},"modified":"2023-04-03T12:12:27","modified_gmt":"2023-04-03T11:12:27","slug":"bot-export-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10\/docs\/bots\/api-guide\/bot-export-api\/","title":{"rendered":"Bot Export 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=\"ult-spacer spacer-6aefeb0d19464\" data-id=\"6aefeb0d19464\" data-height=\"10\" data-height-mobile=\"10\" data-height-tab=\"10\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>To export the bot definition and all the associated components.<\/p>\n<p><b>Note<\/b>: This API only initiates the export process. Please use the <a href=\"\/docs\/bots\/api-guide\/bot-export-status-api\/\" rel=\"noopener noreferrer\" target=\"_blank\">Export Status API<\/a> to view the export progress status and obtain a link to download the file once the export completes.<\/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}}\/export<\/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\/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: Bot Export<\/li>\n<li>Admin Console: Bot Definition > Bot Export<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6aefeb0d196a1\" data-id=\"6aefeb0d196a1\" data-height=\"12\" data-height-mobile=\"12\" data-height-tab=\"12\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<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>host<\/td>\n<td>The environment URL. For example, <code>https:\/\/bots.kore.ai<\/code><\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>BotID<\/td>\n<td><span style=\"font-weight: 400\"><i>Bot ID<\/i> or <i>Stream ID<\/i> can be accessed under <b>General Settings<\/b> on the Bot Builder.<\/span><\/td>\n<td>Required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6aefeb0d19800\" data-id=\"6aefeb0d19800\" data-height=\"12\" data-height-mobile=\"12\" data-height-tab=\"12\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Sample_Request\">Sample Request<\/span><\/h2>\n<pre>curl --location 'https:\/\/{host}\/api\/public\/bot\/{BotID}\/export' \\\r\n--header 'auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMTIyIiwibmFtZSI6IjM0NCIsImFwcElkIjoiY3MtN2Q1NDM2Y2QtNzliNi01YjI3LTg3OTgtMWQyNWNhMWQ5MWE2In0.xKEFeQPof33gbo-CCw-QLvJFrfC0tQEYwWDda1pg024' \\\r\n--header 'content-type: application\/json' \\\r\n--data '{\r\n    \"exportType\": \"published\",\r\n    \"exportOptions\": {\r\n        \"settings\": [\r\n            \"botSettings\",\r\n            \"botVariables\",\r\n            \"ivrSettings\"\r\n        ],\r\n        \"tasks\": [\r\n            \"botTask\",\r\n            \"knowledgeGraph\",\r\n            \"smallTalk\"\r\n        ],\r\n        \"nlpData\": [\r\n            \"nlpSettings\",\r\n            \"utterances\",\r\n            \"patterns\",\r\n            \"standardResponses\"\r\n        ]\r\n    },\r\n    \"subTasks\": {\r\n        \"alerts\": [],\r\n        \"actions\": [],\r\n        \"dialogs\": []\r\n    },\r\n    \"allTasks\": true,\r\n    \"customDashboards\": true,\r\n    \"IncludeDependentTasks\": true\r\n}\u2019\r\n<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6aefeb0d198be\" data-id=\"6aefeb0d198be\" data-height=\"12\" data-height-mobile=\"12\" data-height-tab=\"12\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<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>exportType<\/td>\n<td>\n<p>Bot type &#8211;<\/p>\n<ul>\n<li>&#8216;<em>latest<\/em>&#8216; or<\/li>\n<li>&#8216;<em>published<\/em>&#8216;<\/li>\n<\/ul>\n<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>exportOptions<\/td>\n<td>\n<p>All the bot components are exported by default. If required, you may specify the components to be included for the export.<\/p>\n<p>Usage:<\/p>\n<pre>\"exportOptions\": {\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<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>subTasks<\/td>\n<td>\n<p>For partial export mention the tasks to be exported.<\/p>\n<p>Usage:<\/p>\n<pre>    \"subTasks\": {\r\n        \"dialogs\": [\"&lt;dialog Name 1&gt;\",\"&lt;dialog Name 2&gt;\"],\r\n        \"alerts\": [\"&lt;alert name 1&gt;\",\"&lt;alert name 2&gt;\"],\r\n        \"actions\": [\"&lt;action name 1&gt;\",\"&lt;action name 2&gt;\"]\r\n    }\r\n<\/pre>\n<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>IncludeDependentTasks<\/td>\n<td>\n<p>To include dependent tasks for export.<\/p>\n<p>Usage:<\/p>\n<pre>\"IncludeDependentTasks\": true<\/pre>\n<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>customDashboards<\/td>\n<td>\n<p>To include custom dashboards for export.<\/p>\n<p>Usage:<\/p>\n<pre>\"customDashboards\": true<\/pre>\n<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>allTasks<\/td>\n<td>\n<p>To include all tasks for export, will be ignored if <em>subTasks<\/em> is present.<\/p>\n<p>Usage:<\/p>\n<pre>\"allTasks\": true<\/pre>\n<\/td>\n<td>Optional<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>To learn more about the optional parameters for partial import and dependent tasks, please click <a href=\"\/docs\/bots\/bot-settings\/bot-management\/bot-management-2\/#Exporting_a_Bot\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6aefeb0d19b6a\" data-id=\"6aefeb0d19b6a\" data-height=\"12\" data-height-mobile=\"12\" data-height-tab=\"12\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Sample_Response\">Sample Response<\/span><\/h2>\n<pre>{\r\n    \"status\": \"pending\",\r\n    \"streamId\": \"st-57af1576-bbdc-5ded-a608-5cfbc00c6415\",\r\n    \"createdBy\": \"u-f8708c55-de2c-5690-8821-ac90624779b5\",\r\n    \"exportType\": \"published\",\r\n    \"requestType\": \"Botexport\",\r\n    \"_id\": \"ber-dd746d3c-1631-53af-81ca-03a1d01f0487\",\r\n    \"createdOn\": \"2023-03-31T13:06:16.309Z\",\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 export the bot definition and all the associated components. Note: This API only initiates the export process. Please use the Export Status API to view the export progress status and obtain a link to download the file once the export completes. Method POST Endpoint https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/export Content Type application\/json Authorization auth: {{JWT}} See How to...","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-18086","post","type-post","status-publish","format-standard","hentry","category-api-guide"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10\/wp-json\/wp\/v2\/posts\/18086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10\/wp-json\/wp\/v2\/comments?post=18086"}],"version-history":[{"count":23,"href":"https:\/\/developer.kore.ai\/v10\/wp-json\/wp\/v2\/posts\/18086\/revisions"}],"predecessor-version":[{"id":56496,"href":"https:\/\/developer.kore.ai\/v10\/wp-json\/wp\/v2\/posts\/18086\/revisions\/56496"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10\/wp-json\/wp\/v2\/media?parent=18086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10\/wp-json\/wp\/v2\/categories?post=18086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10\/wp-json\/wp\/v2\/tags?post=18086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}