Classic/VPC 환경에서 이용 가능합니다.
챗봇에 웰컴 메시지가 설정되어 있는 경우 API를 호출했을 때 자동으로 웰컴 메시지를 응답합니다.
참고
챗봇 답변의 응답 컴포넌트는 다음 3가지 형태의 컴포넌트를 제공합니다.
-
Basic Component
-
Composite Component
-
Flex Component
-
컴포넌트에 대한 자세한 내용은 Basic 컴포넌트 상세 정보, Composite 컴포넌트 상세 정보, Flex 컴포넌트 상세 정보를 참조해 주십시오.
요청
요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.
메서드 | URI |
---|---|
POST | CLOVA Chatbot 빌더에서 생성된 API Gateway의 고유 InvokeURL |
요청 헤더
CLOVA Chatbot Custom API에서 공통으로 사용하는 헤더에 대한 정보는 CLOVA Chatbot Custom API 공통 헤더를 참조해 주십시오.
요청 바디
요청 바디에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
version |
String | Optional | 챗봇 버전
|
userId |
String | Required | 챗봇 사용자 고유 아이디
|
userIp |
String | Optional | 사용자 IP 주소 |
timestamp |
Long | Required | 임의의 타임 스탬프 값(Timestamp) |
bubbles |
Array | Required | 비어 있는 배열 또는 Welcome 컴포넌트로 생성된 1개의 Text 컴포넌트 |
event |
String | Required | 이벤트 값
|
bubble
bubble
에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
type |
String | Required | 컴포넌트 유형
|
data |
Object | Required | 컴포넌트 구성 정보 |
data.description |
String | Required | 컴포넌트 상세 설명 |
요청 예시
요청 예시는 다음과 같습니다.
{
"version": "v2",
"userId": "{userId}",
"userIp": "{userIp}",
"timestamp": 12345678,
"bubbles": [
{
"type": "text",
"data" :
{
"description" : "postback text of welcome action"
}
}
],
"event": "open"
}
응답
응답 형식을 설명합니다.
응답 바디
응답 바디에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
version |
String | Optional | 챗봇 버전
|
userId |
String | Required | 챗봇 사용자 고유 아이디
|
timestamp |
Long | Required | 타임 스탬프 값(Timestamp) |
bubbles |
Array | Required | bubbles 상세 정보
|
entities |
Array | Optional | 사용자의 질의에 일치된 챗봇 엔티티 (Entity) 분석 결과 |
persistentMenu |
Object | Optional | 고정 메뉴(Persistent Menu) 정보
|
keywords |
Array | Optional | keywords 상세 정보
|
conversation |
Object | Optional | 대화 구성 정보 |
conversation.scenarioName |
String | Conditional | 시나리오 이름 |
conversation.chatUtteranceSetId |
String | Conditional | 대화 발화 아이디 |
conversation.types |
Array | Conditional | 대화 유형 |
code |
String | Conditional | 오류 코드
|
message |
String | Conditional | 오류 메시지
|
timestamp |
String | Conditional | 응답 시간(Timestamp)
|
event |
String | Required | 이벤트 값 |
bubbles
bubbles
에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
type |
String | Required | 컴포넌트 유형
|
data |
Object | Optional | 컴포넌트 구성 정보 |
data.description |
String | Conditional | 컴포넌트 상세 설명 |
information |
Array | Optional | information 상세 정보 |
information
bubbles.information
에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
key |
String | Conditional | 데이터 키 |
value |
String | Conditional | 데이터 값 |
keywords
keywords
에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
keyword |
String | Conditional | 키워드 |
group |
String | Conditional | 키워드 그룹 |
type |
String | Conditional | 키워드 종류 |
응답 상태 코드
CLOVA Chatbot Custom API에서 공통으로 사용하는 응답 상태 코드에 대한 정보는 CLOVA Chatbot Custom API 공통 응답 상태 코드를 참조해 주십시오.
응답 예시
응답 예시는 다음과 같습니다.
{
"version":"v2",
"userId":"{userId}",
"timestamp":1725842214334,
"bubbles":[
{
"type":"text",
"data":{
"description":"안녕하세요.\n궁금한 점을 챗봇에게 물어보세요."
},
"information":[
{"key":"chatType", "value":"TEXT"},
{"key":"chatType", "value":"TEXT"},
{"key":"defaultMsgType", "value":"welcomeMsg"},
{"key":"welcomeMsgId", "value":"20727"},
{"key":"endOfBubble", "value":"endOfBubble"}
]
}
],
"entities":[],
"persistentMenu":
{
"type":"template",
"title":"PersistentMenu",
"data":
{
"contentTable":[
[
{
"rowSpan":1,
"colSpan":1,
"data":
{
"type":"button",
"title":"PersistentMenu1",
"subTitle":"",
"data":
{
"type":"basic",
"action":
{
"type":"utterance",
"data":
{
"utteranceId":5560752,
"text":"PersistentMenu1",
"postback":"_U_5560752"
}
}}}}]]}},
"keywords":[],
"conversation":
{
"scenarioName":null,
"chatUtteranceSetId":null,
"types":[]
},
"event":"open"
}