콘텐츠로 이동

종료 후 봇 이벤트 실행

Endpoint

[POST] API URL 정보

https://patch-kakao-api.happytalk.io/kakaoWebhook/v3/bzc/chat/endWithBot
https://kakao-api.happytalk.io/kakaoWebhook/v3/bzc/chat/endWithBot

Introduce

Introduce
상담 완료 시, 세션 종료와 함께 설정된 봇의 이벤트 말블럭을 실행하는 API입니다. 
봇이 비활성 상태이거나 블럭이 유효하지 않은 경우 메시지가 발송되지 않습니다.

Request (Json)

Field Name Type Required Description
Content-Type Text Y application/json
HT-Client-Id Text Y 고객센터에서 발급 받은 key
HT-Client-Secret Text Y 고객센터에서 발급 받은 token

Body

Field Name Type (Length) Required Description
user_key Text(20) Y 사용자 키
sender_key Text(40) Y 발신프로필 키
bot_event Text(100) N 봇 이벤트 명

Example

REST API Sample
curl -L -X POST 'https://patch-kakao-api.happytalk.io/kakaoWebhook/v3/bzc/chat/endWithBot' \
-H 'Content-Type: application/json' \
-H 'HT-Client-Id: example-id' \
-H 'HT-Client-Secret: example-secret' \
-d '{"user_key":"example-user_key","sender_key":"example-sender_key","bot_event":"start_bot"}'
curl -L -X POST 'https://kakao-api.happytalk.io/kakaoWebhook/v3/bzc/chat/endWithBot' \
-H 'Content-Type: application/json' \
-H 'HT-Client-Id: example-id' \
-H 'HT-Client-Secret: example-secret' \
-d '{"user_key":"example-user_key","sender_key":"example-sender_key","bot_event":"start_bot"}'

Response (Json)

Parameter

Field Name Type Description
code Text 처리 결과 코드 (0은 정상 / 나머지는 오류)
message Text 처리 실패 시 결과 메시지
session_id Text 종료된 세션아이디 (현재 요청에 의해 정상적으로 종료된 세션이 있을 경우 존재)

Example

Success
{
    "code": 0,
    "session_id": "123212"
}
Failure
{
    "code": -501,
    "message": "InvalidSenderException(senderKey: test-key)"
}

Data Dictionary

Data Dictionary

None

None

Reference

코드 정의