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

kakao developers

Related sites
  • Docs
  • Kakao Talk Message
  • JavaScript

사이드 메뉴

Kakao Map

Search

Kakao Talk Message

JavaScript

This document describes how to integrate Kakao Talk Message APIs into your service with the Kakao SDK for JavaScript ("JavaScript SDK").

You can test the features described in this document in [Tools] > [JS SDK demo] menu.

Guide to Kakao Talk message sending feature

  • The Kakao Talk Message API supports sending messages only between users within the same service.
  • You must have permission to use the Kakao Talk Social API to use the feature to send messages to friends.
  • For details, see Message sending features and How to use.

Before you begin

You need to select which API to call based on the type of message to send and the configuration method. Follow the steps below to select the API to use before development.

Choose implementation method

1. Select message sending feature

Kakao Developers provides two types of message sending features: Kakao Talk Share and Kakao Talk Message. Refer to Message sending features to select the feature to use. If you want to use Kakao Talk Message, perform the following steps.

Scope of support

The JavaScript SDK does not support Kakao Talk Message API in built-in function form. To use Kakao Talk Message API with JavaScript SDK on a web page, use the Kakao.API.request function to make a request to the same URL as the REST API.

2. Select message type and configuration method

Refer to Template types to decide which message template to use.

You can configure messages to send using default templates based on predefined templates in object form, or custom templates configured directly for your service. Refer to Configuration method comparison.

3. Select message target

Note that for Kakao Talk Message, the APIs used are distinguished according to the message targets.

TargetDescription
Send to meSends a message to the "Me" chat in Kakao Talk of the currently logged-in user. This feature cannot send messages to other users and can only send messages to the logged-in user themselves.
Send to friendsSends a message to friends in Kakao Talk of the currently logged-in user.
Important: Additional feature request is required.
You must implement a process to receive recipient information through Picker or Retrieve Kakao Talk friends list. You can send messages to up to 5 friends at once. Daily and monthly quotas are set, so refer to Quota.
Permission required to send messages to friends

If you want to send messages to friends, Request permission is required. See Usage Policy as well.

Send me message with default template

Basic information

Sends a message to the user's My Chatroom using the predefined default template in JSON format.

First, you need to configure objects according to the desired template type. For configuration methods, refer to Default template.

When calling the Kakao.API.request() function, pass the previously configured template object as the template_object parameter.

Kakao.API.request() returns a Promise. For the response content when the request succeeds, refer to REST API.

Request

Parameter
NameTypeDescriptionRequired
urlStringFixed to /v2/api/talk/memo/default/send.O
dataObjectParameters to pass to the API.O
data: Sending me message with default template
NameTypeDescriptionRequired
template_objectObjectObject containing message components
One of Feed, List, Location, Commerce, Text, Calendar
O

Sample

Kakao.API.request({
url: '/v2/api/talk/memo/default/send',
data: {
template_object: {
object_type: 'feed',
content: {
title: 'Strawberry cheese cake',
description: '#cake #strawberry #cafe #atmosphere #blinddate',
image_url: 'https://mud-kage.kakao.com/dn/Q2iNx/btqgeRgV54P/VLdBs9cvyn8BJXB3o7N8UK/kakaolink40_original.png',
link: {
web_url: 'https://developers.kakao.com',
mobile_web_url: 'https://developers.kakao.com',
},
},
item_content: {
profile_text: 'Kakao',
profile_image_url: 'https://mud-kage.kakao.com/dn/Q2iNx/btqgeRgV54P/VLdBs9cvyn8BJXB3o7N8UK/kakaolink40_original.png',
title_image_url: 'https://mud-kage.kakao.com/dn/Q2iNx/btqgeRgV54P/VLdBs9cvyn8BJXB3o7N8UK/kakaolink40_original.png',
title_image_text: 'Cheese cake',
title_image_category: 'Cake',
items: [
{
item: 'Cake1',
item_op: '1000 won',
},
{
item: 'Cake2',
item_op: '2000 won',
},
{
item: 'Cake3',
item_op: '3000 won',
},
{
item: 'Cake4',
item_op: '4000 won',
},
{
item: 'Cake5',
item_op: '5000 won',
},
],
sum: 'Total',
sum_op: '15000 won',
},
social: {
like_count: 100,
comment_count: 200,
},
buttons: [
{
title: 'View on Web',
link: {
mobile_web_url: 'https://developers.kakao.com',
web_url: 'https://developers.kakao.com',
},
},
{
title: 'View on App',
link: {
mobile_web_url: 'https://developers.kakao.com',
web_url: 'https://developers.kakao.com',
},
},
],
},
},
})
.then(function (response) {
console.log(response)
})
.catch(function (error) {
console.log(error)
})

Send me message with custom template

Basic information

Sends a message to the user's My Chatroom using a custom template configured in [Tools] > [Message Template].

When calling the Kakao.API.request() function, you must pass the custom template ID as the template_id parameter.

Kakao.API.request() returns a Promise. For the response content when the request succeeds, refer to REST API.

Request

Parameter
NameTypeDescriptionRequired
urlStringFixed to /v2/api/talk/memo/send.O
dataObjectParameters to pass to the API.O
data: Sending me message with custom template
NameTypeDescriptionRequired
template_idNumberMessage template ID configured in [Tools] > [Message Template].O
template_argsObjectRequired when the message template specified by template_id uses user arguments
Pass in key:value format

Important: If you do not use this parameter even though the custom template uses user arguments, the part specified as user arguments will be exposed in the message as ${KEY} format.
Important: When using user parameters in URL query parameters, apply Form URL Encoding (application/x-www-form-urlencoded) to the corresponding value.
X

Sample

Kakao.API.request({
url: '/v2/api/talk/memo/send',
data: {
template_id: ${YOUR_TEMPLATE_ID},
},
})
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
});

Send me scrape message

Basic information

Sends a scrape message to the user's My Chatroom using information extracted from the specified web page URL.

If you need to send to other users, use the Send scrape message API.

When calling the Kakao.API.request() function, you must pass the web page URL to scrape as the request_url parameter. The domain of the web page to be scraped must be registered in [App] > [Product Link] > [Web domain] on the app management page.

Kakao.API.request() returns a Promise. For the response content when the request succeeds, refer to REST API.

Request

Parameter
NameTypeDescriptionRequired
urlStringFixed to /v2/api/talk/memo/scrap/send.O
dataObjectParameters to pass to the API.O
data: Sending me scrape message
NameTypeDescriptionRequired
request_urlStringWeb page URL to be scraped
Important: Only domains registered in [App] > [Product Link] > [Web domain] on the app management page can be used
O
template_idNumberMessage template ID configured in [Tools] > [Message Template]
Used when you want to send scrape messages based on service-defined message templates
(Refer to: Custom template)
X
template_argsObjectRequired when the message template specified by template_id uses user arguments
Pass in key:value format
Cannot overwrite (overwrite) scrape results

Important: If you do not use this parameter even though the custom template uses user arguments, the part specified as user arguments will be exposed in the message as ${KEY} format.
Important: When using user parameters in URL query parameters, apply Form URL Encoding (application/x-www-form-urlencoded) to the corresponding value.
X

Example: Using default template

Kakao.API.request({
url: '/v2/api/talk/memo/scrap/send',
data: {
request_url: 'https://developers.kakao.com',
},
})
.then(function (response) {
console.log(response)
})
.catch(function (error) {
console.log(error)
})

Example: Using custom template

Kakao.API.request({
url: '/v2/api/talk/memo/scrap/send',
data: {
request_url: 'https://developers.kakao.com',
template_id: ${YOUR_TEMPLATE_ID},
},
})
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
});

Send message with default template

Basic information

Sends a message composed in JSON according to the predefined default template format.

First, you need to configure objects according to the desired template type. For configuration methods, refer to Default template.

When calling the Kakao.API.request() function, pass the previously configured template object as the template_object parameter.

Kakao.API.request() returns a Promise. For the response content when the request succeeds, refer to REST API.

Request

Parameter
NameTypeDescriptionRequired
urlStringFixed to /v1/api/talk/friends/message/default/send.O
dataObjectParameters to pass to the API.O
data: Sending friends message with default template
NameTypeDescriptionRequired
receiver_uuidsString[]User uuid values obtained through Picker or Retrieve Kakao Talk friends list API
Can send messages to up to 5 users at once
O
template_objectObjectObject containing message components
One of Feed, List, Location, Commerce, Text, Calendar
O

Sample

Kakao.API.request({
url: '/v1/api/talk/friends/message/default/send',
data: {
receiver_uuids: ['${RECEIVER_UUID}'],
template_object: {
object_type: 'feed',
content: {
title: 'Strawberry cheese cake',
description: '#cake #strawberry #cafe #atmosphere #blinddate',
image_url: 'https://mud-kage.kakao.com/dn/Q2iNx/btqgeRgV54P/VLdBs9cvyn8BJXB3o7N8UK/kakaolink40_original.png',
link: {
web_url: 'https://developers.kakao.com',
mobile_web_url: 'https://developers.kakao.com',
},
},
item_content: {
profile_text: 'Kakao',
profile_image_url: 'https://mud-kage.kakao.com/dn/Q2iNx/btqgeRgV54P/VLdBs9cvyn8BJXB3o7N8UK/kakaolink40_original.png',
title_image_url: 'https://mud-kage.kakao.com/dn/Q2iNx/btqgeRgV54P/VLdBs9cvyn8BJXB3o7N8UK/kakaolink40_original.png',
title_image_text: 'Cheese cake',
title_image_category: 'Cake',
items: [
{
item: 'Cake1',
item_op: '1000 won',
},
{
item: 'Cake2',
item_op: '2000 won',
},
{
item: 'Cake3',
item_op: '3000 won',
},
{
item: 'Cake4',
item_op: '4000 won',
},
{
item: 'Cake5',
item_op: '5000 won',
},
],
sum: 'Total',
sum_op: '15000 won',
},
social: {
like_count: 100,
comment_count: 200,
},
buttons: [
{
title: 'View on Web',
link: {
mobile_web_url: 'https://developers.kakao.com',
web_url: 'https://developers.kakao.com',
},
},
{
title: 'View on App',
link: {
mobile_web_url: 'https://developers.kakao.com',
web_url: 'https://developers.kakao.com',
},
},
],
},
},
})
.then(function (response) {
console.log(response)
})
.catch(function (error) {
console.log(error)
})

Send message with custom template

Basic information

Sends a message using a custom template configured in [Tools] > [Message Template].

When calling the Kakao.API.request() function, you must pass the custom template ID as the template_id parameter.

Kakao.API.request() returns a Promise. For the response content when the request succeeds, refer to REST API.

Request

Parameter
NameTypeDescriptionRequired
urlStringFixed to /v1/api/talk/friends/message/send.O
dataObjectParameters to pass to the API.O
data: Sending friends message with custom template
NameTypeDescriptionRequired
receiver_uuidsString[]User uuid values obtained through Picker or Retrieve Kakao Talk friends list API
Can send messages to up to 5 users at once
O
template_idNumberMessage template ID configured in [Tools] > [Message Template].O
template_argsObjectRequired when the message template specified by template_id uses user arguments
Pass in key:value format

Important: If you do not use this parameter even though the custom template uses user arguments, the part specified as user arguments will be exposed in the message as ${KEY} format.
Important: When using user parameters in URL query parameters, apply Form URL Encoding (application/x-www-form-urlencoded) to the corresponding value.
X

Example

Kakao.API.request({
url: '/v1/api/talk/friends/message/send',
data: {
receiver_uuids: ['${RECEIVER_UUID}'],
template_id: ${YOUR_TEMPLATE_ID},
},
})
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
});

Send scrap message

Basic information

Sends a scrape message using information extracted from the specified web page URL.

When calling the Kakao.API.request() function, you must pass the web page URL to scrape as the request_url parameter. The domain of the web page to be scraped must be registered in [App] > [Product Link] > [Web domain] on the app management page.

Kakao.API.request() returns a Promise. For the response content when the request succeeds, refer to REST API.

Request

Parameter
NameTypeDescriptionRequired
urlStringFixed to /v1/api/talk/friends/message/scrap/send.O
dataObjectParameters to pass to the API.O
data: Sending friends scrape message with default template
NameTypeDescriptionRequired
receiver_uuidsString[]User uuid values obtained through Picker or Retrieve Kakao Talk friends list API.
Can send messages to up to 5 users at once.
O
request_urlStringWeb page URL to be scraped.
Important: Only domains registered in [App] > [Product Link] > [Web domain] on the app management page can be used.
O
template_idNumberMessage template ID configured in [Tools] > [Message Template].
Used when you want to send a scrape message with the template registered in [Tools] > [Message Template].
Specify the ID of the template to apply.
When you use this parameter, the scraped content is applied in the template with the specified template_id.
X
template_argsObjectIf you specify template_id and the specified template contains other user arguments besides the default argument keys, pass the user arguments using this parameter in key:value format.
Cannot overwrite scrape results.

Important: If you do not use this parameter even though the custom template uses user arguments, the part specified as user arguments will be exposed in the message as ${KEY} format.
Important: When using user parameters in URL query parameters, apply Form URL Encoding (application/x-www-form-urlencoded) to the corresponding value.
X

Example: Using default template

Kakao.API.request({
url: '/v1/api/talk/friends/message/scrap/send',
data: {
receiver_uuids: ['${RECEIVER_UUID}'],
request_url: 'https://developers.kakao.com',
},
})
.then(function (response) {
console.log(response)
})
.catch(function (error) {
console.log(error)
})

Example: Using custom template

Kakao.API.request({
url: '/v1/api/talk/friends/message/scrap/send',
data: {
receiver_uuids: ['${RECEIVER_UUID}'],
request_url: 'https://developers.kakao.com',
template_id: ${YOUR_TEMPLATE_ID},
},
})
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
});

Upload image

You can attach images to a message by passing an image URL when configuring a message template or by uploading images in the Message template tool in advance. For detailed instructions and examples, see Upload image.

See more

Was this helpful?