본문 바로가기메인 메뉴 바로가기사이드 메뉴 바로가기

kakao developers

Related sites
  • Docs
  • Kakao Talk Share
  • Webhook

사이드 메뉴

Kakao Map

Search

Kakao Talk Share

Webhook

This document introduces the Kakao Talk Share webhook feature.

Before you begin

This document explains the webhook requests that Kakao sends to your service's endpoint. Note that this specification describes incoming webhook requests from Kakao, not API requests that your service makes to Kakao.

For the overall workflow and detailed implementation guide for webhooks, see Implementation steps.

Required: Custom parameter configuration

When invoking the Kakao Talk Share API via the SDK, you must specify custom parameters using serverCallbackArgs to receive the Kakao Talk Share webhook. For more details, see the development guides as below.

Kakao Talk Share webhook

Basic information
MethodURLRequired response formatAuthentication
GET/POSTWebhook URL registered in [My Applications] > [Messages] > [Kakao Talk Share Webhook]HTTP status code 2XX (within 3 seconds)Primary admin key

The Kakao Talk Share webhook notifies the service when a Kakao Talk Share message is successfully delivered to the selected friends or chat rooms.

Upon receiving the webhook, the service must respond with an HTTP status code 2XX within 3 seconds.

Kakao Talk Share and Kakao Talk Message API

Message delivery results of Kakao Talk Share API can only be confirmed through webhook implementation. Refer to the Overview for the differences between these APIs.

Prerequisites

The Kakao Talk Share webhook requires specifying a webhook URL and method to be used, and redirection is not supported. For configuration details, refer to Set Kakao Talk Share webhook.

Additionally, to receive the Kakao Talk Share webhook, user-defined parameters must be specified with serverCallbackArgs when sending a Kakao Talk Share message. For the details, see the platform-specific development guides below.

Request

Header
NameTypeDescriptionRequired
AuthorizationStringAuthorization: KakaoAK ${SERVICE_APP_ADMIN_KEY}
App admin key used to verify whether the webhook is valid.
O
X-Kakao-Resource-IDStringX-Kakao-Resource-ID: ${UNIQUE_ID}
Unique ID for distinguishing each webhook.
O
User-AgentStringUser-Agent: KakaoOpenAPI/1.0
String indicating that the webhook was sent from Kakao.
O
Parameter
NameTypeDescriptionRequired
CHAT_TYPEStringType of chatroom to which Kakao Talk Share message is sent.

One of the followings:
  • MemoChat: My Chatroom
  • DirectChat: 1:1 chat with other users
  • MultiChat: Group chat with other users
  • OpenDirectChat: 1:1 Open Chat
  • OpenMultiChat: Group Open Chat
O
HASH_CHAT_IDStringA reference ID of the chatroom that receives a Kakao Talk Share message.
As a unique hash value for each service, a different ID is assigned for each service, even for the same chatroom.
O
${CUSTOM_KEY}":"${CUSTOM_VALUE}JSONCustom parameter defined by a service when calling the Kakao Talk Share API through the SDK.
Input the keys and values of serverCallbackArgs parameter in JSON format.
(Example: {"user_id":"abcd","product_id":1234})
O
TEMPLATE_IDLongThe message template ID used when sending a Kakao Talk Share message using the message template ID.
If you do not use the message template ID when requesting, an empty value is returned in the response.
X
IS_SINGLE_CHATROOMBooleanIndicates whether the chatroom is a single chatroom where only the sender is participating or the only one remaining.
  • true: The chatroom where no other participants exist besides the sender
  • false: The chatroom where other participants exist besides the sender
(For example, if CHAT_TYPE is MultiChat but only the sender is participating, the response is true).

Important: Only available to the apps with paid usage settings enabled.
X
CHAT_MEMBER_COUNT_RANGEStringThe range of the number of participants in the chatroom to which the Kakao Talk Share message is sent.
One of the following:
  • 1+: 1 or more but less than 5
  • 5+: 5 or more but less than 10
  • 10+: 10 or more but less than 30
  • 30+: 30 or more but less than 50
  • 50+: 50 or more but less than 100
  • 100+: 100 or more but less than 500
  • 500+: 500 or more but less than 1000
  • 1000+: 1000 or more
  • UNKNOWN: Unknown

Important: Only available to the apps with paid usage settings enabled.
X

Response

You must respond with HTTP status code 2XX within 3 seconds of receiving the webhook request.

Sample

Theses are examples of the webhook request that Kakao sends to your service when the Kakao Talk message is successfully delivered.

Request: GET method
curl -v -G GET "${KAKAOLINK_CALLBACK_URL}?CHAT_TYPE=MemoChat&HASH_CHAT_ID=${HASH_CHAT_ID}&TEMPLATE_ID=10000&custom_parameter_key=custom_parameter_value" \
-H "Authorization: KakaoAK ${SERVICE_APP_ADMIN_KEY}" \
-H "X-Kakao-Resource-ID: ${UNIQUE_ID}" \
-H "User-Agent: KakaoOpenAPI/1.0"
Request: POST method
curl -v -X POST "${KAKAOLINK_CALLBACK_URL}" \
-H "Authorization: KakaoAK ${SERVICE_APP_ADMIN_KEY}" \
-H "X-Kakao-Resource-ID: ${UNIQUE_ID}" \
-H "User-Agent: KakaoOpenAPI/1.0" \
-H "Content-Type: application/json" \
-d '{
"CHAT_TYPE":"MemoChat",
"HASH_CHAT_ID":"${HASH_CHAT_ID}",
"TEMPLATE_ID":10000,
"custom_parameter_key":"custom_parameter_value"
}'

Was this helpful?