새로운 버전으로 업그레이드하거나 이전 버전으로 복원하기 위해 봇 정의 파일을 기존 봇으로 가져오는 데 사용됩니다.

이 API를 사용하려면 오직 봇 관리자 콘솔에서 생성된 애플리케이션에서 만들어진 JWT가 필요합니다.
이 API를 사용하려면 봇 정의 아래에 있는 봇 가져오기의 관리자 API 범위가 필요합니다.

POST https://{{host}}/api/public/bot/{{BotID}}/import

쿼리 매개 변수

 

매개 변수 설명
host 환경 URL(예: https://bots.kore.ai)
BotID 봇 ID 또는 스트림 ID. 봇의 일반 설정 페이지에서 이를 액세스할 수 있습니다.

본문 매개 변수

매개 변수 설명
botDefinition “봇 정의 파일 ID” (확인하려면 여기 참조)
configInfo “봇 설정 파일 ID” (확인하려면 여기 참조.)
botFunctions (선택 사항 필드) “Fileid”
importOptions

기본적으로 모든 봇 구성 요소를 가져옵니다. 필요한 경우 불러오기에 포함할 구성 요소를 지정할 수 있습니다.

"importOptions": {
   "tasks": [
     "botTask",
     "knowledgeGraph"
     ],
   "nlpData": [
     "nlpSettings",
     "utterances",
     "standardResponses"
     ],
   "settings": [
     "botSettings",
     "botVariables",
     "ivrSettings"
     ]
 },

options

(선택 사항)

이는 ML 발화의 증분 가져오기 옵션의 교체 또는 추가 여부를 나타내며 자세한 내용은 여기를 참조하세요.

"options": {
     "utterances": {
        "replace": true
	"append":false
        }

범용 봇
범용 봇 가져오기의 경우 importOptions는 아래와 같이 조금 다릅니다.

"importOptions": {
	"nlpData": [
		"training_data",
		"bot_synonyms",
		"nlpSettings",
		"defaultDialog",
		"standardResponses"
	],
	"settings": [
		"botSettings",
		"ivrSettings",
		"botVariables",
		"ivrSettings"
	],
	"options": {
		"utterances": {
		"append": true,
		"replace": false
		}
	},
	"botComponents": [
		"linkedBots",
		"smallTalk"
	],
	"customDashboard": true
}

권한 부여

다음 구문을 포함한 헤더에 JWT를 포함한 API를 호출합니다.

auth: {{JWT}}

콘텐츠 유형 응답

application/json

샘플 요청

curl -X POST \
  https://{{host}}/api/public/bot/{{BotID}}/import \
  -H 'auth: YOUR_JWT_ACCESS_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "botDefinition" : "5b7ed2b87cab5c48ea9794f9",
  "configInfo" : "5b7ed2d77cab5c48ea9794fa",
  "botFunctions":["5b7ed33a86a5fc48f4777ea6"]
}'

범용 봇에 대한 샘플 요청

curl -X POST \
  https://{{host}}/api/public/bot/{{BotID}}/import \
  -H 'auth: YOUR_JWT_ACCESS_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "botDefinition" : "5b7ed2b87cab5c48ea9794f9",
  "configInfo" : "5b7ed2d77cab5c48ea9794fa",
  "importOptions": {
	"nlpData": [
		"training_data",
		"bot_synonyms",
		"nlpSettings",
		"defaultDialog",
		"standardResponses"
	],
	"settings": [
		"botSettings",
		"ivrSettings",
		"botVariables",
		"ivrSettings"
	],
	"options": {
		"utterances": {
		"append": true,
		"replace": false
		}
	},
	"botComponents": [
		"linkedBots",
		"smallTalk"
	],
	"customDashboard": true
}
}'

샘플 응답

{
    "streamRefId": "c685t327-8f93-588b-97bb-3399fa998bca",
    "statusLogs": [
        {
            "taskType": "importRequest",
            "taskName": "Sample Task",
            "status": "success"
        }
    ],
    "createdBy": "u-3ae8bd39-a63e-5b2c-b55b-85864a8202c3",
    "requestType": "Botimport",
    "_id": "bir-00b2baf0-7e02-523b-b317-79a372b91fc6",
    "status": "pending",
    "createdOn": "2018-12-05T07:40:51.956Z",
    "__v": 0
}

Used to import bot definition file into an existing bot for upgrading to a new version or restoring to an earlier version.

This API requires JWT generated by an application created only from Bot Admin Console.
To use this API, app needs the Admin API Scope of Bot Import under Bot Definition.

POST https://{{host}}/api/public/bot/{{BotID}}/import

Query Parameters

 

Parameter Description
host Environment URL, for example, https://bots.kore.ai
BotID Bot ID or Stream ID. You can access it from the General Settings page of the bot.

Body Parameters

Parameter Description
botDefinition “Bot Definition File id” (refer here to obtain it)
configInfo “Bot Configuration File id” (refer here to obtain it)
botFunctions (Optional Field) “Fileid”
importOptions

All bot components are imported by default. If needed, you may specify the components to be included in the import.

"importOptions": {
   "tasks": [
     "botTask",
     "knowledgeGraph"
     ],
   "nlpData": [
     "nlpSettings",
     "utterances",
     "standardResponses"
     ],
   "settings": [
     "botSettings",
     "botVariables",
     "ivrSettings"
     ]
 },

options

(optional)

This will indicate incremental import options for the ML utterances, whether to replace or append, see here for more.

"options": {
     "utterances": {
        "replace": true
	"append":false
        }

Universal Bot
For Universal bot import the importOptions differ slightly, as shown below:

"importOptions": {
	"nlpData": [
		"training_data",
		"bot_synonyms",
		"nlpSettings",
		"defaultDialog",
		"standardResponses"
	],
	"settings": [
		"botSettings",
		"ivrSettings",
		"botVariables",
		"ivrSettings"
	],
	"options": {
		"utterances": {
		"append": true,
		"replace": false
		}
	},
	"botComponents": [
		"linkedBots",
		"smallTalk"
	],
	"customDashboard": true
}

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/public/bot/{{BotID}}/import \
  -H 'auth: YOUR_JWT_ACCESS_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "botDefinition" : "5b7ed2b87cab5c48ea9794f9",
  "configInfo" : "5b7ed2d77cab5c48ea9794fa",
  "botFunctions":["5b7ed33a86a5fc48f4777ea6"]
}'

Sample Request for Universal Bot

curl -X POST \
  https://{{host}}/api/public/bot/{{BotID}}/import \
  -H 'auth: YOUR_JWT_ACCESS_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "botDefinition" : "5b7ed2b87cab5c48ea9794f9",
  "configInfo" : "5b7ed2d77cab5c48ea9794fa",
  "importOptions": {
	"nlpData": [
		"training_data",
		"bot_synonyms",
		"nlpSettings",
		"defaultDialog",
		"standardResponses"
	],
	"settings": [
		"botSettings",
		"ivrSettings",
		"botVariables",
		"ivrSettings"
	],
	"options": {
		"utterances": {
		"append": true,
		"replace": false
		}
	},
	"botComponents": [
		"linkedBots",
		"smallTalk"
	],
	"customDashboard": true
}
}'

Sample Response

{
    "streamRefId": "c685t327-8f93-588b-97bb-3399fa998bca",
    "statusLogs": [
        {
            "taskType": "importRequest",
            "taskName": "Sample Task",
            "status": "success"
        }
    ],
    "createdBy": "u-3ae8bd39-a63e-5b2c-b55b-85864a8202c3",
    "requestType": "Botimport",
    "_id": "bir-00b2baf0-7e02-523b-b317-79a372b91fc6",
    "status": "pending",
    "createdOn": "2018-12-05T07:40:51.956Z",
    "__v": 0
}