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

kakao developers

Related sites
  • Docs
  • Kakao Talk Channel
  • JavaScript

사이드 메뉴

Kakao Map

Search

Kakao Talk Channel

JavaScript

This document describes how to integrate Kakao Talk Channel 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.

Before you begin

Select Method to add Kakao Talk Channel

Follow Kakao Talk Channel and Add Kakao Talk Channel are available. Refer to Add Kakao Talk Channel and decide what to use. Follow Kakao Talk Channel is recommended because of the easy implementation.

Get code for adding or starting chat button

When using the JavaScript SDK, you can download the Kakao Talk Channel buttons provided by Kakao, and add the buttons to your website according to the desired button size or function. Go to [Tools] > [Social Plugin] menu, and then generate a source code intended to add the Add Channel or Start chat button.

Follow Kakao Talk Channel

Basic information

Requests adding Kakao Talk Channel to the user.

Kakao Login

Follow Kakao Talk Channel is available without Kakao Login.

However, to avoid an inconvenient login process, we recommend using Follow Kakao Talk Channel in a **service with Kakao Login**.

Displays a screen for adding Kakao Talk Channel and returns the result in the response.

To use Follow Kakao Talk Channel in the service using Kakao Login, set token to the JavaScript SDK. Refer to Set token.

Request

Request followChannel(). Kakao Talk Channel profile ID is required. Refer to Services using Kakao Login and Services not using Kakao Login for the request process.

Response

If the request is successful, the response includes the Kakao Talk Channel profile ID and the result. If the request fails, refer to Trouble shooting to figure out the reason.

Sample

Kakao.Channel.followChannel({
channelPublicId: '${CHANNEL_PUBLIC_ID}',
})
.then(function (response) {
console.log(response)
// Success
})
.catch(function (error) {
console.error(error)
// Fail
})

Add Kakao Talk Channel

Basic information

Provides a bridge page that lets users go to a Kakao Talk Channel and add it as a friend.

To use this feature, users must be in a logged-in state. If users click [Add Channel] in a logged-out state, direct them to the login page to log in.

Request

You can use this feature by using either the createAddChannelButton() or addChannel() function. When you want to add the [Add Channel] button and apply this feature to the button, use createAddChannelButton(). If you want to apply this feature to a component on a web page, use addChannel().

  • createAddChannelButton()
    • Using a button that Kakao provides.
    • Specify the element ID to container parameter.
  • addChannel()
    • Using a custom button and call addChannel() function by the click event handler.

Specify Kakao Talk Channel profile ID to channelPublicId parameter. Refer to Kakao Talk Channel profile ID.

Response

This API does not inform you whether a user has added the Kakao Talk Channel. To check the added status, use the Check Kakao Talk Channel relationship API that shows the relationship between a user and a Kakao Talk Channel.

Sample

Kakao.Channel.createAddChannelButton({
container: '#kakao-add-channel-button',
channelPublicId: '_ZeUTxl', // Use the ID included in the home URL of Kakao Talk Channel.
})

Start Kakao Talk Channel chat

Basic information

Provides a bridge page to start a chat with a the Kakao Talk channel on Kakao Talk.

To use this feature, users must be in a logged-in state. If users click [Chat] in a logged-out state, direct them to the login page to log in.

Request

You can implement a feature to allow users to start a Kakao Talk chat by using either the createChatButton() or chat() function.

  • createChatButton()
    • Using a button that Kakao provides.
    • Specify the element ID to container parameter.
  • chat()
    • Using a custom button and call chat() function by the click event handler.

Specify Kakao Talk Channel profile ID to channelPublicId parameter. Refer to Kakao Talk Channel profile ID.

Response

This API does not inform you whether the user has successfully started the chat.

Sample

Kakao.Channel.createChatButton({
container: '#kakao-talk-channel-chat-button',
channelPublicId: '_ZeUTxl', // Use the ID included in the home URL of Kakao Talk Channel.
})

Check Kakao Talk Channel relationship

Basic information

Checks whether a specific user has added or blocked your Kakao Talk Channel connected to your service app.

Make sure that this API only informs the relationship between the user and the Kakao Talk Channel connected to the app that made a request. Thus, you cannot get all Kakao Talk Channels' information that the user has added but the channels related to your service only.

Kakao Talk Channel webhook

To get a notification when a user adds or blocks one of your Kakao Talk Channels linked to you service, use the Kakao Talk Channel webhook function.

Request

Call the Kakao.API.request() function, and set url to /v1/api/talk/channels.

Response

Kakao.API.request() returns Promise. For the detailed response fields returned if the promise is fulfilled, refer to REST API > Check Kakao Talk Channel relationship.

Parameter
NameTypeDescriptionRequired
urlStringFixed to '/v1/api/talk/channels'.O

Sample

Kakao.API.request({
url: '/v1/api/talk/channels',
})
.then(function (response) {
console.log(response)
})
.catch(function (error) {
console.log(error)
})

See more

Was this helpful?