Imports global and content variables into the bot.
To use this API, app needs the Bot Builder API scope of Import Variables.
POST https://{{host}}/api/{{version}}/public/builder/stream/{{BotID}}/variables/import
Query Parameters
Parameter | Description |
---|---|
host | Environment URL, for example, https://bots.kore.ai |
BotID | Bot ID. You can access it from the General Settings page of the bot. |
Body Parameters
Parameter | Description |
---|---|
key | Name of the Variable |
value | Value for the variable |
hint | Description of the variable |
variableType | Type of variable can be
|
scope | Scope of the variable corresponds to the Setup Option at the time of variable declaration and can be
|
localeData | For variables of type locale, additional language data needs to be passed in the following format for each language:
{ "en": { "value": "english language prompt", "hint": "" } } |
Authorization
Invoke the API with JWT in the header with the following syntax:
auth: {{JWT}}
Response content type
application/JSON
Sample Request
curl -X POST \ https://{{host}}/api/1.1/public/builder/stream/{{BotId}}/variables/import \ -H 'Content-Type: application/json' \ -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \ -d '[ { "key": "Global", "value": "Globalkey-prePopulated", "hint": "", "variableType": "env", "scope": "prePopulated" }, { "key": "Lang", "variableType": "locale", "scope": "prePopulated", "localeData": { "en": { "value": "english language prompt", "hint": "" } } } ]'
Sample Response
{ "message": "2 Variables imported/updated successfully." }