Send

Prev Next

Classic/VPC 환경에서 이용 가능합니다.

챗봇으로 질문을 전달합니다.

참고

챗봇 답변의 응답 컴포넌트는 다음 3가지 형태의 컴포넌트를 제공합니다.

요청

요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.

메서드 URI
POST CLOVA Chatbot 빌더에서 생성된 API Gateway의 고유 InvokeURL

요청 헤더

CLOVA Chatbot API에서 공통으로 사용하는 헤더에 대한 정보는 CLOVA Chatbot 요청 헤더를 참조해 주십시오.

요청 바디

요청 바디에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
version String Optional 챗봇 버전
  • v1 | v2 (기본값)
    • 미입력 시 v1 설정
userId String Required 챗봇 사용자 고유 아이디
  • 최대 256자 이내로 입력
userIp String Optional 사용자 IP 주소
timestamp Long Required 임의의 타임 스탬프 값(Timestamp)
bubbles Array Required 1개의 Text 컴포넌트만 지원
  • 자세한 내용은 Text 컴포넌트 참조
  • 1개 이상의 text 컴포넌트가 있을 경우, 마지막 컴포넌트를 사용
  • bubbles 상세 정보: bubbles
event String Required 이벤트 값
  • send로 설정

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" : "콘솔에서 CLOVA Chatbot 서비스에 어떻게 접근하나요?" 
        } 
    } 
],
"event": "send"
}

응답

응답 형식을 설명합니다.

응답 바디

응답 바디에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
version String - 챗봇 버전
  • v1 | v2
    • 요청 시 입력하지 않으면 v1으로 응답됨
userId String - 챗봇 사용자 고유 아이디
  • 요청 시 설정한 userId 값과 동일
sessionId String - 현재 세션 아이디
  • CLOVA Chatbot에서 관리
timestamp Long - 타임 스탬프 값(ms)
bubbles Array - bubbles 상세 정보: bubbles
  • 응답 컴포넌트의 배열
  • 각 컴포넌트는 챗봇의 응답 버블(Bubble)과 일치
scenario Object - 시나리오 정보
  • 사용자의 질의에 일치된 시나리오 분석 결과
  • 시나리오 이름 및 의도(대화 유형) 제공
scenario.name String - 시나리오 이름
scenario.chatUtteranceSetId Long - 시나리오 발화 유형 아이디
scenario.intent Array - 시나리오 의도(대화 유형)
entities Array - 사용자의 질의에 일치된 챗봇 엔티티 (Entity) 분석 결과
quickButtons Array - 챗봇 하단에 설정된 고정 버튼 정보
keywords Array - keywords 상세 정보: keywords
  • exactMatch | contain
    • exactMatch: 사용자 입력 값과 키워드가 일치
    • contain: 사용자 입력 값에 키워드가 포함
conversation Object - 대화 정보
conversation.scenarioName String - 시나리오 이름
conversation.chatUtteranceSetId Long - 대화 발화 유형 아이디
conversation.types Array - 대화 유형
normalizer String - 사용자의 질의에 일치된 시스템 엔티티 (Entity)
event String - 이벤트 값

bubbles

bubbles에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
type String - 컴포넌트 유형
title String - 컴포넌트 이름
data Object - 컴포넌트 구성 정보
data.description String - 컴포넌트 상세 설명
data.url String - URL 주소
data.urlAlias String - URL 별칭
data.packageId String - LINE Sticker 패키지 아이디
data.stickerId String - LINE Sticker 스티커 아이디
information Array - information 상세 정보
context Array - 컴포넌트 맥락 정보

information

information에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
key String - 데이터 키
value String - 데이터 값

keywords

keywords에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
keyword String - 키워드
group String - 키워드 그룹
type String - 키워드 종류

응답 상태 코드

CLOVA Chatbot API에서 공통으로 사용하는 응답 상태 코드에 대한 정보는 CLOVA Chatbot 응답 상태 코드를 참조해 주십시오.

응답 예시

응답 예시는 다음과 같습니다.

기본 답변

기본 답변인 경우의 응답 예시는 다음과 같습니다.

{
  "version": "v2",
  "userId": "{userId}",
  "timestamp": 1664169457884,
  "bubbles": [
    {
      "type": "text",
      "data": {
        "description": "Chatbot Answer",
        "url": "https://ncloud.com", // optional : URL
        "urlAlias": "https://ncloud.com" // optional : URL
      },
      "information": [
        {
          "key": "chatType",
          "value": "TEXT"
        },
        {
          "key": "chatType",
          "value": "TEXT"
        },
        {
          "key": "score",
          "value": "1.0"
        },
        {
          "key": "scenarioName",
          "value": "Conversation Name"
        },
        {
          "key": "endOfBubble",
          "value": "endOfBubble"
        },
        {
          "key": "matchingType",
          "value": "exactMatch"
        },
        {
          "key": "domainCode",
          "value": "Domain Code"
        }
      ],
      "context": []
    }
  ],
  "scenario": {
    "name": "Conversation Name",
    "chatUtteranceSetId": 4929383, // 대화 발화 아이디 (Conversation ID)
    "intent": []
  },
  "entities": [],
  "keywords": [],
  "conversation": {
    "scenarioName": "Conversation Name",
    "chatUtteranceSetId": 4929383, // 대화 발화 아이디 (Conversation ID)
    "types": []
  },
  "normalizer": "null",
  "event": "send"
}

이미지 답변

이미지 답변인 경우의 응답 예시는 다음과 같습니다.

{
  "version": "v2",
  "userId": "{userId}",
  "timestamp": 1664170469355,
  "bubbles": [
    {
      "type": "carousel",
      "data": {
        "cards": [
          {
            "type": "template",
            "data": {
              "cover": {
                "type": "image",
                "data": {
                  "imageUrl": "https://clovachatbot.ncloud.com/i48103278ci6f6-9f51-4d08-a947-1c8acc992629",
                  "imagePosition": "top",
                  "action": {
                    "type": "link",
                    "data": {
                      "url": "https://ncloud.com"
                    }
                  }
                }
              }
            }
          }
        ]
      }
    }
  ],
  "scenario": {
    "name": "Conversation Name",
    "chatUtteranceSetId": 4929385, // 대화 발화 아이디 (Conversation ID)
    "intent": []
  },
  "entities": [],
  "keywords": [],
  "conversation": {
    "scenarioName": "Conversation Name",
    "chatUtteranceSetId": 4929385, // 대화 발화 아이디 (Conversation ID)
    "types": []
  },
  "normalizer": "null",
  "event": "send"
}

이미지+텍스트 답변

이미지+텍스트 답변인 경우의 응답 예시는 다음과 같습니다.

{
  "version": "v2",
  "userId": "{userId}",
  "timestamp": 1664170681849,
  "bubbles": [
    {
      "type": "carousel",
      "data": {
        "cards": [
          {
            "type": "template",
            "data": {
              "cover": {
                "type": "image",
                "title": "image title",
                "data": {
                  "imageUrl": "https://clovachatbot.ncloud.com/i48103278ci6f6-9f51-4d08-a947-1c8acc992629",
                  "description": "image description"
                }
              },
              "contentTable": [
                [
                  {
                    "rowSpan": 1,
                    "colSpan": 1,
                    "data": {
                      "type": "button",
                      "title": "display button1 name",
                      "data": {
                        "type": "basic",
                        "action": {
                          "type": "link",
                          "data": {
                            "url": "https://ncloud.com"
                          }
                        }
                      }
                    }
                  }
                ],
                [
                  {
                    "rowSpan": 1,
                    "colSpan": 1,
                    "data": {
                      "type": "button",
                      "title": "display button2 name",
                      "data": {
                        "type": "basic",
                        "action": {
                          "type": "link",
                          "data": {
                            "url": "https://fin-ncloud.com"
                          }
                        }
                      }
                    }
                  }
                ]
              ]
            },
            "information": [
              {
                "key": "carousel",
                "value": "1"
              },
              {
                "key": "chatType",
                "value": "IMAGECARD"
              },
              {
                "key": "imageOnly",
                "value": "false"
              },
              {
                "key": "chatType",
                "value": "IMAGECARD"
              },
              {
                "key": "score",
                "value": "1.0"
              },
              {
                "key": "scenarioName",
                "value": "Conversation Name"
              },
              {
                "key": "matchingType",
                "value": "exactMatch"
              },
              {
                "key": "domainCode",
                "value": "Domain Code"
              }
            ],
            "context": []
          }
        ]
      }
    }
  ],
  "scenario": {
    "name": "Conversation Name",
    "chatUtteranceSetId": 4929386, // 대화 발화 아이디 (Conversation ID)
    "intent": []
  },
  "entities": [],
  "keywords": [],
  "conversation": {
    "scenarioName": "Conversation Name",
    "chatUtteranceSetId": 4929386, // 대화 발화 아이디 (Conversation ID)
    "types": []
  },
  "normalizer": "null",
  "event": "send"
}

멀티링크 답변

멀티링크 답변인 경우의 응답 예시는 다음과 같습니다.

{
  "version": "v2",
  "userId": "{userId}",
  "timestamp": 1664171090887,
  "bubbles": [
    {
      "type": "template",
      "data": {
        "cover": {
          "type": "text",
          "data": {
            "description": "Chatbot Answer"
          }
        },
        "contentTable": [
          [
            {
              "rowSpan": 1,
              "colSpan": 1,
              "data": {
                "type": "button",
                "title": "Button Name",
                "data": {
                  "type": "basic",
                  "action": {
                    "type": "link",
                    "data": {
                      "url": "https://ncloud.com"
                    }
                  }
                }
              }
            }
          ]
        ]
      },
      "information": [
        {
          "key": "chatType",
          "value": "MULTILINKS"
        },
        {
          "key": "chatType",
          "value": "MULTILINKS"
        },
        {
          "key": "score",
          "value": "1.0"
        },
        {
          "key": "scenarioName",
          "value": "Conversation Name"
        },
        {
          "key": "endOfBubble",
          "value": "endOfBubble"
        },
        {
          "key": "matchingType",
          "value": "exactMatch"
        },
        {
          "key": "domainCode",
          "value": "Domain Code"
        }
      ],
      "context": []
    }
  ],
  "scenario": {
    "name": "Conversation Name",
    "chatUtteranceSetId": 4929384, // 대화 발화 아이디 (Conversation ID)
    "intent": []
  },
  "entities": [],
  "keywords": [],
  "conversation": {
    "scenarioName": "Conversation Name",
    "chatUtteranceSetId": 4929384, // 대화 발화 아이디 (Conversation ID)
    "types": []
  },
  "normalizer": "null",
  "event": "send"
}

폼 V1 (객관식) 답변

폼 V1 (객관식) 답변인 경우의 응답 예시는 다음과 같습니다.

{
  "version": "v2",
  "userId": "{userId}",
  "timestamp": 1664171277095,
  "bubbles": [
    {
      "type": "template",
      "data": {
        "cover": {
          "type": "text",
          "data": {
            "description": "Chatbot Answer"
          }
        },
        "contentTable": [
          [
            {
              "rowSpan": 1,
              "colSpan": 1,
              "data": {
                "type": "button",
                "title": "Button Name", // 버튼 이름이 표시되게 할 경우 이 값을 사용 (Use this value if you want the button name to be displayed.)
                "data": {
                  "type": "basic",
                  "action": {
                    "type": "postback",
                    "data": {
                      "postback": "Button Name",
                      "postbackFull": "_T_Button Name" // 버튼이 실행되게 할 경우 이 값을 사용 (Use this value if you want a button action.)
                    }
                  }
                }
              }
            }
          ]
        ]
      },
      "information": [
        {
          "key": "imageOnly",
          "value": "false"
        },
        {
          "key": "chatType",
          "value": "SINGLEFORM"
        },
        {
          "key": "chatType",
          "value": "SINGLEFORM"
        },
        {
          "key": "score",
          "value": "1.0"
        },
        {
          "key": "scenarioName",
          "value": "Conversation Name"
        },
        {
          "key": "endOfBubble",
          "value": "endOfBubble"
        },
        {
          "key": "matchingType",
          "value": "exactMatch"
        },
        {
          "key": "domainCode",
          "value": "Domain Code"
        },
        {
          "key": "formStart",
          "value": "true"
        },
        {
          "key": "serviceLinkedToForm",
          "value": ""
        }
      ],
      "context": []
    }
  ],
  "scenario": {
    "name": "Conversation Name",
    "chatUtteranceSetId": 4929388, // 대화 발화 아이디 (Conversation ID)
    "intent": []
  },
  "entities": [],
  "keywords": [],
  "conversation": {
    "scenarioName": "Conversation Name",
    "chatUtteranceSetId": 4929388, // 대화 발화 아이디 (Conversation ID)
    "types": []
  },
  "normalizer": "null",
  "event": "send"
}

폼 V2 (객관식) 답변

폼 V2 (객관식) 답변인 경우의 응답 예시는 다음과 같습니다.

{
  "version": "v2",
  "userId": "{userId}",
  "timestamp": 1664171884718,
  "bubbles": [
    {
      "type": "template",
      "data": {
        "cover": {
          "type": "text",
          "data": {
            "description": "Chatbot Answer"
          }
        },
        "contentTable": [
          [
            {
              "rowSpan": 1,
              "colSpan": 1,
              "data": {
                "type": "button",
                "title": "Button Name",
                "data": {
                  "type": "basic",
                  "action": {
                    "type": "postback",
                    "data": {
                      "postback": "UnexpiredForm\u241e47952\u241e0",
                      "displayText": "Button Name", // 버튼 이름이 표시되게 할 경우 이 값을 사용 (Use this value if you want the button name to be displayed.)
                      "postbackFull": "_T_UnexpiredForm\u241e47952\u241e0" // 버튼이 실행되게 할 경우 이 값을 사용 (Use this value if you want a button action.)
                    }
                  }
                }
              }
            }
          ]
        ]
      },
      "information": [
        {
          "key": "imageOnly",
          "value": "false"
        },
        {
          "key": "chatType",
          "value": "SINGLEFORM"
        },
        {
          "key": "chatType",
          "value": "SINGLEFORM"
        },
        {
          "key": "score",
          "value": "1.0"
        },
        {
          "key": "scenarioName",
          "value": "Conversation Name"
        },
        {
          "key": "endOfBubble",
          "value": "endOfBubble"
        },
        {
          "key": "matchingType",
          "value": "exactMatch"
        },
        {
          "key": "domainCode",
          "value": "Domain Code"
        },
        {
          "key": "formStart",
          "value": "true"
        }
      ],
      "context": []
    }
  ],
  "scenario": {
    "name": "Conversation Name",
    "chatUtteranceSetId": 4929389, // 대화 발화 아이디 (Conversation ID)
    "intent": []
  },
  "entities": [],
  "keywords": [],
  "conversation": {
    "scenarioName": "Conversation Name",
    "chatUtteranceSetId": 4929389, // 대화 발화 아이디 (Conversation ID)
    "types": []
  },
  "normalizer": "null",
  "event": "send"
}

폼 V1 (Quick reply) 답변

폼 V1 (Quick reply) 답변인 경우의 응답 예시는 다음과 같습니다.

{
  "version": "v2",
  "userId": "{userId}",
  "timestamp": 1664172269192,
  "bubbles": [
    {
      "type": "text",
      "data": {
        "description": "Chatbot Answer"
      },
      "information": [
        {
          "key": "imageOnly",
          "value": "false"
        },
        {
          "key": "chatType",
          "value": "SINGLEFORM"
        },
        {
          "key": "chatType",
          "value": "SINGLEFORM"
        },
        {
          "key": "score",
          "value": "1.0"
        },
        {
          "key": "scenarioName",
          "value": "Conversation Name"
        },
        {
          "key": "endOfBubble",
          "value": "endOfBubble"
        },
        {
          "key": "matchingType",
          "value": "exactMatch"
        },
        {
          "key": "domainCode",
          "value": "Domain Code"
        },
        {
          "key": "formStart",
          "value": "true"
        },
        {
          "key": "serviceLinkedToForm",
          "value": ""
        }
      ],
      "context": []
    }
  ],
  "scenario": {
    "name": "Conversation Name",
    "chatUtteranceSetId": 4929390, // 대화 발화 아이디 (Conversation ID)
    "intent": []
  },
  "entities": [],
  "quickButtons": [
    {
      "type": "button",
      "title": "Button Name",
      "data": {
        "type": "basic",
        "action": {
          "type": "postback",
          "data": {
            "postback": "Button Name",
            "postbackFull": "_T_Button Name" // 버튼이 실행되게 할 경우 이 값을 사용 (Use this value if you want a button action.)
          }
        }
      }
    }
  ],
  "keywords": [],
  "conversation": {
    "scenarioName": "Conversation Name",
    "chatUtteranceSetId": 4929390, // 대화 발화 아이디 (Conversation ID)
    "types": []
  },
  "normalizer": "null",
  "event": "send"
}

폼 V2 (Quick reply) 답변

폼 V2 (Quick reply) 답변인 경우의 응답 예시는 다음과 같습니다.

{
  "version": "v2",
  "userId": "{userId}",
  "timestamp": 1664172948306,
  "bubbles": [
    {
      "type": "text",
      "data": {
        "description": "Chatbot Answer"
      },
      "information": [
        {
          "key": "imageOnly",
          "value": "false"
        },
        {
          "key": "chatType",
          "value": "SINGLEFORM"
        },
        {
          "key": "chatType",
          "value": "SINGLEFORM"
        },
        {
          "key": "score",
          "value": "1.0"
        },
        {
          "key": "scenarioName",
          "value": "Conversation Name"
        },
        {
          "key": "endOfBubble",
          "value": "endOfBubble"
        },
        {
          "key": "matchingType",
          "value": "exactMatch"
        },
        {
          "key": "domainCode",
          "value": "Domain Code"
        },
        {
          "key": "formStart",
          "value": "true"
        }
      ],
      "context": []
    }
  ],
  "scenario": {
    "name": "Conversation Name",
    "chatUtteranceSetId": 4929393, // 대화 발화 아이디 (Conversation ID)
    "intent": []
  },
  "entities": [],
  "quickButtons": [
    {
      "type": "button",
      "title": "Button Name",
      "data": {
        "type": "basic",
        "action": {
          "type": "postback",
          "data": {
            "postback": "UnexpiredForm\u241e47954\u241e0",
            "displayText": "Button Name", // 버튼 이름이 표시되게 할 경우 이 값을 사용 (Use this value if you want the button name to be displayed.)
            "postbackFull": "_T_UnexpiredForm\u241e47954\u241e0" // 버튼이 실행되게 할 경우 이 값을 사용 (Use this value if you want a button action.)
          }
        }
      }
    }
  ],
  "keywords": [],
  "conversation": {
    "scenarioName": "Conversation Name",
    "chatUtteranceSetId": 4929393, // 대화 발화 아이디 (Conversation ID)
    "types": []
  },
  "normalizer": "null",
  "event": "send"
}

폼 주관식 답변

폼 주관식 답변인 경우의 응답 예시는 다음과 같습니다.

{
  "version": "v2",
  "userId": "{userId}",
  "timestamp": 1665038738758,
  "bubbles": [
    {
      "type": "text",
      "data": {
        "description": "Chatbot Answer"
      },
      "information": [
        {
          "key": "chatType",
          "value": "TEXT"
        },
        {
          "key": "chatType",
          "value": "TEXT"
        },
        {
          "key": "score",
          "value": "1.0"
        },
        {
          "key": "scenarioName",
          "value": "Conversation Name"
        },
        {
          "key": "endOfBubble",
          "value": "endOfBubble"
        },
        {
          "key": "matchingType",
          "value": "exactMatch"
        },
        {
          "key": "domainCode",
          "value": "Domain Code"
        },
        {
          "key": "formStart",
          "value": "true"
        }
      ],
      "context": []
    }
  ],
  "scenario": {
    "name": "Conversation Name",
    "chatUtteranceSetId": 4929394, // 대화 발화 아이디 (Conversation ID)
    "intent": []
  },
  "entities": [],
  "keywords": [],
  "conversation": {
    "scenarioName": "Conversation Name",
    "chatUtteranceSetId": 4929394, // 대화 발화 아이디 (Conversation ID)
    "types": []
  },
  "normalizer": "null",
  "event": "send"
}

답변 없음 답변

답변 없음 답변인 경우의 응답 예시는 다음과 같습니다.

{
  "version": "v2",
  "userId": "{userId}",
  "timestamp": 1665972966091,
  "bubbles": [
    {
      "type": "text",
      "data": {
        "description": ""
      },
      "information": [
        {
          "key": "chatType",
          "value": "NOANSWER"
        },
        {
          "key": "chatType",
          "value": "NOANSWER"
        },
        {
          "key": "score",
          "value": "1.0"
        },
        {
          "key": "scenarioName",
          "value": "Conversation Name"
        },
        {
          "key": "endOfBubble",
          "value": "endOfBubble"
        },
        {
          "key": "matchingType",
          "value": "exactMatch"
        },
        {
          "key": "domainCode",
          "value": "Domain Code"
        }
      ],
      "context": []
    }
  ],
  "scenario": {
    "name": "Conversation Name",
    "chatUtteranceSetId": 4929395,
    "intent": []
  },
  "entities": [],
  "keywords": [],
  "conversation": {
    "scenarioName": "Conversation Name",
    "chatUtteranceSetId": 4929395,
    "types": []
  },
  "normalizer": "null",
  "event": "send"
}

LINE Flex

LINE Flex인 경우의 응답 예시는 다음과 같습니다.

{
  "version": "v2",
  "userId": "{userId}",
  "sessionId": "{sessionId}",
  "timestamp": 12345678,
  "bubbles": [
    {
      "type": "flex",
      "title": "this is a flex message",
      "data" : {
        "type": "bubble",
        "hero": {
          "type": "image",
          "url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/01_1_cafe.png",
          "size": "full",
          "aspectRatio": "20:13",
          "aspectMode": "cover",
        },
        "body": {
          "type": "box",
          "layout": "vertical",
          "contents": [
            {
              "type": "text",
              "text": "Brown Cafe",
              "weight": "bold",
              "size": "xl"
            }
          ]
        },
        "footer": {
          "type": "box",
          "layout": "vertical",
          "spacing": "sm",
          "contents": [
            {
              "type": "button",
              "style": "link",
              "height": "sm",
              "action": {
                "type": "uri",
                "label": "CALL",
                "uri": "https://linecorp.com"
              }
            },
            {
              "type": "spacer",
              "size": "sm"
            }
          ],
          "flex": 0
        }
      }
    }
  ],
  "event": "send"
}

LINE Sticker

LINE Sticker인 경우의 응답 예시는 다음과 같습니다.

{
  "type": "line_sticker",
  "data": {
    "packageId": "446",
    "stickerId": "1988"
  },
  "information": [
    {
      "key": "chatType",
      "value": "STICKER"
    },
    {
      "key": "chatType",
      "value": "STICKER"
    },
    {
      "key": "tagInfo",
      "value": "platformExactMatch=line"
    },
    {
      "key": "score",
      "value": "1.0"
    },
    {
      "key": "scenarioName",
      "value": "Conversation Name"
    },
    {
      "key": "endOfBubble",
      "value": "endOfBubble"
    },
    {
      "key": "matchingType",
      "value": "exactMatch"
    },
    {
      "key": "domainCode",
      "value": "Domain Code"
    }
  ],
  "context": [],
  "event": "send"
}