{"id":18086,"date":"2018-12-04T13:55:30","date_gmt":"2018-12-04T13:55:30","guid":{"rendered":"https:\/\/developer.kore.ai\/v8-0\/?post_type=docs&#038;p=15663"},"modified":"2021-03-25T07:52:14","modified_gmt":"2021-03-25T07:52:14","slug":"bot-export-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v8-0\/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\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>Used to export bot definition and all associated components. This API only initiates the export process. Use <a href=\"\/docs\/bots\/api-guide\/bot-export-status-api\/\">Export Status API<\/a> to view the progress of the export and also to get a link to download the file once the export is completed.<\/p>\n<p class=\"note\">To use this API, app needs the Admin API Scope of <em>Bot Export<\/em> under <em>Bot Definition<\/em>.<\/p>\n<p><b>POST<\/b> <span style=\"font-weight: 400\"><code>https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/export<\/code><\/span><\/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><span style=\"font-weight: 400\">host<\/span><\/td>\n<td><span style=\"font-weight: 400\">Environment URL, for example, <code>https:\/\/bots.kore.ai<\/code><\/span><\/td>\n<\/tr>\n<tr>\n<td>BotID<\/td>\n<td><span style=\"font-weight: 400\">Bot ID or Stream ID. You can access it from the General Settings page of the bot.<\/span><\/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>exportType<\/td>\n<td>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<\/tr>\n<tr>\n<td>exportOptions (optional)<\/td>\n<td>All bot components are exported by default. If needed, you may specify the components to be included in the export.<\/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<\/tr>\n<tr>\n<td>subTasks<br \/>\n(optional)<\/td>\n<td>For partial export mention the tasks to be exported.<\/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<\/tr>\n<tr>\n<td>IncludeDependentTasks<br \/>\n(optional)<\/td>\n<td>To include dependent tasks for export<\/p>\n<pre>\"IncludeDependentTasks\":<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td>allTasks<br \/>\n(optional)<\/td>\n<td>To include all tasks for export, will be ignored if <em>subTasks<\/em> is present<\/p>\n<pre>\"allTasks\":<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>For more on the optional parameters for partial import and dependent tasks, <a href=\"\/docs\/bots\/bot-settings\/bot-management\/bot-management-2\/#Exporting_a_Bot\" target=\"_blank\" rel=\"noopener noreferrer\">see here<\/a>.<\/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=\"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\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=\"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  https:\/\/{{host}}\/api\/public\/bot\/{{BotID}\/export \\\r\n  -H 'auth: {{<em>YOUR_JWT_ACCESS_TOKEN}}<\/em>' \\\r\n  -H 'content-type: application\/json' \\\r\n  -d '{\r\n     \"exportType\": \"published\"\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    \"status\": \"pending\",\r\n    \"streamId\": \"st-xxxxx-xxx-xxx-xxx-xxxxx\",\r\n    \"createdBy\": \"u-xxx-xxx-xxx-xxx-xxxxx\",\r\n    \"exportType\": \"published\",\r\n    \"requestType\": \"Botexport\",\r\n    \"_id\": \"ber-xxxxx-xxx-xxx-xxx-xxxxx\",\r\n    \"status\": \"pending\",\r\n    \"createdOn\": \"2018-12-05T07:18:40.028Z\",\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":"Used to export bot definition and all associated components. This API only initiates the export process. Use Export Status API to view the progress of the export and also to get a link to download the file once the export is completed. To use this API, app needs the Admin API Scope of Bot Export...","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\/v8-0\/wp-json\/wp\/v2\/posts\/18086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/comments?post=18086"}],"version-history":[{"count":11,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts\/18086\/revisions"}],"predecessor-version":[{"id":23084,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts\/18086\/revisions\/23084"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/media?parent=18086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/categories?post=18086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/tags?post=18086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}