페이지 이동경로
  • Docs>
  • Message>
  • Kakao Talk Sharing: Callback

Message

Kakao Talk Sharing: Callback

This document introduces callback information for Kakao Talk Sharing.

Before you begin

Check the Usage policy before using the callback.

Kakao Talk Sharing success callback

Basic information
Method URL Authorization
GET/POST Callback URL registered in [My Application] > [Message] > [Kakao Talk Sharing Callback].
(Example: https://example.com/kakaolink/callback)
Service app admin key
Permission Prerequisite Kakao Login User consent
- Set Kakao Talk Sharing success callback - -

Kakao Talk Sharing success callback is a function to send a callback request to the callback URL of your server specified in the Kakao Developers when a Kakao Talk Sharing message is successfully sent to the selected users or chatrooms. This function lets your service know whether users successfully receive a Kakao Talk Sharing message through Kakao Talk.

What you must do
Moment What you must do
Before requesting the Kakao Talk Sharing API Allow Kakao IP addresses.
Register Kakao Talk Sharing callback in [My Application] > [Message] > [Kakao Talk Sharing Callback].
When requesting the Kakao Talk Sharing API Specify a custom parameter by using serverCallbackArgs by referring to the following development documentation:
- Android SDK
- iOS SDK
- JavaScript SDK
After getting callback Send a link callback response to the Kakao server within 3 seconds with the HTTP status code "200 OK".

The Kakao Talk Sharing success callback is only sent to the specified callback URL of the service server with a GET or POST method when a Kakao Talk Sharing message is successfully sent to a chatroom. You can check if the callback is valid by checking the admin key passed as Authorization in the request header and then process the callback request. The custom parameters set through the Kakao SDK are also passed in the success link callback. The success link callback is sent only once and not re-sent even when it fails.

When you get the success link callback, you must respond back to the request within 3 seconds by sending a link callback response to the Kakao server with the HTTP status code "200 OK". Ensure that the other status codes except for "200 OK" are considered as failure. The status codes in the Redirection 3xx class are also not supported. The response body in your callback response is ignored because the Kakao server determines success or failure with the HTTP status code.

Below is the detailed information of the Kakao Talk Sharing success callback that Kakao sends to your service server.

Request

Header
Name Type Description Required
Authorization String The Admin key as a type of user authentication.
Authorization: KakaoAK ${SERVICE_APP_ADMIN_KEY}
O
X-Kakao-Resource-ID String Unique ID for each Kakao Talk Sharing success callback. O
User-Agent String String used to identify the request sent from Kakao.
Fixed as KakaoOpenAPI/1.0.
O
Parameter
Name Type Description Required
CHAT_TYPE String Type of chatroom to which Kakao Talk Sharing 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_ID String A reference ID of the chatroom that receives a Kakao Talk Sharing message.
As a unique hash value for each service, a different ID is assigned for each service, even for the same chatroom.
O
TEMPLATE_ID Long The message template ID used when sending a Kakao Talk Sharing 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

Sample

Callback Request
GET /link/callback?CHAT_TYPE=MemoChat&HASH_CHAT_ID=%227cb74349530306cc59ba8058898b656b%22&TEMPLATE_ID=10000&custom_parameter_key=custom_parameter_value HTTP/1.1
Host: ${YOUR_WEB_DOMAIN}
Authorization: KakaoAK ${SERVICE_APP_ADMIN_KEY}
X-Kakao-Resource-ID: 8WVBcBDqPk6g7CJxR2pLX7W9
User-Agent: KakaoOpenAPI/1.0
POST /link/callback HTTP/1.1
Host: ${YOUR_WEB_DOMAIN}
Authorization: KakaoAK ${SERVICE_APP_ADMIN_KEY}
X-Kakao-Resource-ID: Rvy1c2dkzBAZ5hGD3rqYbxvr
User-Agent: KakaoOpenAPI/1.0
Content-Type: application/json
Content-Length: XX

{"CHAT_TYPE":"MemoChat","HASH_CHAT_ID":"%227cb74349530306cc59ba8058898b656b%22","TEMPLATE_ID":10000,"custom_parameter_key":"custom_parameter_value"}

Best practices

If you set a custom parameter, you can:

  • Get callback only for the desired messages because the Kakao server sends a callback only for the Kakao Talk Sharing API calls that include the custom parameter. If you do want to get a callback for a specific message, do not include the custom parameter when calling the Kakao Talk Sharing API.
  • Figure out which message is successfully sent. The Kakao server sends a callback along with the custom parameter as you specified, so you can check additional message information, such as the sender or the shared contents.

You can leverage the Kakao Talk Sharing success callback function as reference information about the message delivery result, along with the custom parameters. If you send a Kakao Talk Sharing message using a message template ID, you can figure out which message has been sent through the TEMPLATE_ID parameter. You can also know how many chatrooms a specific message has been sent to by checking HASH_CHAT_ID.

In addition, if you pass the sender information through serverCallbackArgs when requesting the Kakao Talk Sharing API, you can get both the information of the message sender and the chatroom that received the message. With the information, you can figure out how many times a specific sender has sent a message to the same chatroom or how many chatrooms the sender has sent a message to.