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