This API allows you to update the default language for a bot using the botId.
Method | POST |
Endpoint |
|
Content Type | application/json |
Authorization | auth: {{JWT}}
|
API Scope |
|
Path Parameters
Parameter | Required | Description |
host | Yes | The environment URL. For example, https://bots.kore.ai . |
botId | Yes | Bot ID or Stream ID. You can access it from the General Settings page of the bot. |
Sample Request
curl --location '>https://{{host}}/api/1.1/public/bot/st-5ac72231-5a37-5b71-bb1e-1be02ef0xxxx/defaultLanguage' \
--header 'Content-Type: application/json' \
--header 'auth: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6ImNzLTc5NmQ0NTUwLWFmYTItNWRlZS1hZGFhLTQ4NjhkMzJjNmRmYiJ9.y64D-jY0HsktGBggW63hk4pPbMIfqxgUH0Z4X5oxxxx' \
--data '{
"Language": "en"
}'
Body Parameters
Parameter | Description | Mandate |
languageCode | The ISO Language code (for example, en-US for American English, es-ES for Spanish). | required |
Sample Response
Success Response
{ "status": "success", "message": "Default language has been updated successfully.", "language code": "en-US" }
Error Response
Scenario 1: If the request fails, because of the missing scope from the bot.
{ "errors":[ { "message": "Permission denied. Scope is incorrect!", "code": 4002 } ] }
Scenario 2: If the language is not even configured and the user tries to make that language the default
Error Message: Cannot set default language. The language '{{language code}}' is not currently configured. Please configure the language and publish the bot at least once before setting it as the default
Scenario 3: If the user tries to make the same language as default by mistake which is already a default language
Error Message: Permission denied. The language '{{language code}}' is already set as the default language.
Scenario 4: If the user tries to change the default language which is “ disabled ”
Error Message: Unable to change the default language. The language '{{language code}}' is currently disabled. Please enable the language before setting it as the default.
Scenario 5: If the user has never published the bot for the new language after enabling it and tries to make that language the default
{ "status": "Error", "message": "Unable to set default language. Please perform a full publish of the bot, including all content for {{language code}}, before setting it as the default language. Partial publishing is not sufficient for this operation" }
Scenario 6: if the code itself is wrong in the body, for example, “Language“: “ eh“ ( instead of en)
Error message: Please provide the valid language code
Note:
- There is no rollback once the API execution is complete.
- No publishing is required to display the default language in published mode.
- Once the API is executed, the default language will be reflected immediately.