{"id":48940,"date":"2022-11-20T06:06:56","date_gmt":"2022-11-20T06:06:56","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?p=48940"},"modified":"2024-01-03T12:06:24","modified_gmt":"2024-01-03T12:06:24","slug":"add-and-enable-a-new-language-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/api-guide\/add-and-enable-a-new-language-api\/","title":{"rendered":"Add and Enable a New Language 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-6ae87215d84f9\" data-id=\"6ae87215d84f9\" 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 initiate the addition and enablement of a new language for a virtual assistant.<\/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\/1.1\/public\/bot\/{{botId}}\/language<\/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><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\" target=\"_blank\" rel=\"noopener noreferrer\">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: Language Configuration<\/li>\n<li>Admin Console: Language Settings &gt; Language Management<\/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-6ae87215d86c0\" data-id=\"6ae87215d86c0\" 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<h2><span class=\"ez-toc-section\" id=\"Path_Parameters\">Path Parameters<\/span><\/h2>\n<table>\n<tbody>\n<tr>\n<th><b>Parameter<\/b><\/th>\n<th><b>Required<\/b><\/th>\n<th><b>Description<\/b><\/th>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">host<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Yes<\/span><\/td>\n<td>The environment URL. For example, <code>https:\/\/bots.kore.ai<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">botId<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Yes<\/span><\/td>\n<td>Bot ID or Stream ID. You can access it from the General Settings page of the bot.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae87215d8807\" data-id=\"6ae87215d8807\" 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<h2><span class=\"ez-toc-section\" id=\"Sample_Request\">Sample Request<\/span><\/h2>\n<pre class=\"code-limit-400px\">curl --location 'https:\/\/bots.kore.ai\/api\/1.1\/public\/bot\/st-70xx8595-ebcf-58xf-9xx7-5da61fexxxxx\/language' \\\r\n--header 'Content-Type: application\/json' \\\r\n--header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \\ \r\n--data '{\r\n\"enableLanguage\": \"es\",\r\n\"langDefinitionMode\":\r\n{\r\n\"baseLanguage\": \"en\",\r\n\"type\": \"advancedConfig\",\r\n\"preferredData\":\r\n{\r\n\"training\": true,\r\n\"faqs\": true,\r\n\"ontology\": true,\r\n\"smalltalk\": true,\r\n\"traits\": true\r\n}\r\n},\r\n\"multiLingualConfigurations\":\r\n{\r\n\"nluLanguage\": \"en\",\r\n\"inputTranslation\": true,\r\n\"responseTranslation\": true\r\n}\r\n}'<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae87215d8899\" data-id=\"6ae87215d8899\" 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<h2><span class=\"ez-toc-section\" id=\"Body_Parameters\">Body Parameters<\/span><\/h2>\n<table>\n<tbody>\n<tr>\n<th><b>Parameter<\/b><\/th>\n<th><b>Description<\/b><\/th>\n<th><b>Mandate<\/b><\/th>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">enableLanguage<\/span><\/td>\n<td>The language to be enabled based on the language code.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">langDefinitionMode<\/span><\/td>\n<td>The Language Definition Mode object.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">langDefinitionMode.baseLanguage<\/span><\/td>\n<td>Base language of the Virtual Assistant.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">langDefinitionMode.type<\/span><\/td>\n<td>Type of language enablement <b>Basic<\/b>, <b>advancedConfig<\/b>, or <b>fileUpload<\/b>.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">langDefinitionMode.fileId<\/span><\/td>\n<td>The <b>file ID<\/b> for handling the file upload if the <b>fileUpload<\/b> language enablement is selected.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">langDefinitionMode.preferredData<\/span><\/td>\n<td>If the <b>advancedConfig<\/b> language enablement is selected, the True\/False configuration setting for &#8220;training&#8221;, &#8220;faqs&#8221;, &#8220;ontology&#8221;, &#8220;Smalltalk&#8221; and &#8220;traits&#8221; keys should be included.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>multiLingualConfigurations<\/td>\n<td>The multi Lingual Configurations object.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>multiLingualConfigurations.nluLanguage<\/td>\n<td>Refers to the language code of the bot language.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>multiLingualConfigurations.inputTranslation<\/td>\n<td>Refers to True\/False setting for the input language translation to English.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>multiLingualConfigurations.responseTranslation<\/td>\n<td>Refers to the True\/False setting for the response language translation to English.<\/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-6ae87215d8b3d\" data-id=\"6ae87215d8b3d\" 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<h2><span class=\"ez-toc-section\" id=\"Sample_Response\">Sample Response<\/span><\/h2>\n<p>For success case:<\/p>\n<pre>{\r\n    \"message\": \"Enabled Spanish language successfully\",\r\n    \"configurationDetails\": {\r\n        \"dialogs\": 2,\r\n        \"alerts\": 0,\r\n        \"actions\": 0,\r\n        \"knowledgetTasks\": 0,\r\n        \"smallTalk\": 1,\r\n        \"panels\": 0,\r\n        \"widgets\": 0\r\n    }\r\n}<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae87215d8bc8\" data-id=\"6ae87215d8bc8\" 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><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"To initiate the addition and enablement of a new language for a virtual assistant. Method POST Endpoint https:\/\/{{host}}\/api\/1.1\/public\/bot\/{{botId}}\/language Content Type application\/json Authorization auth: {{JWT}} See How to generate the JWT Token. API Scope Bot Builder: Language Configuration Admin Console: Language Settings &gt; Language Management Path Parameters Parameter Required Description host Yes The environment URL. For...","protected":false},"author":21,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-48940","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\/48940","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\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=48940"}],"version-history":[{"count":28,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/48940\/revisions"}],"predecessor-version":[{"id":60947,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/48940\/revisions\/60947"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=48940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=48940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=48940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}