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

kakao developers

Related sites

사이드 메뉴

Kakao Map

Search

REST API

This document describes the v1 version of the Checking Kakao Talk Channel relationship API.

Check Kakao Talk Channel relationship

Basic information
MethodURLAuthorization
GEThttps://kapi.kakao.com/v1/api/talk/channelsAccess token
Service app admin key
PermissionPrerequisiteKakao LoginUser consent
RequiredAdmin key
Activate Kakao Login
Manage consent items
Set Kakao Talk Channel
RequiredRequired:
Kakao Talk Channel addition status and details

This API enables you to check if a specific user has added or blocked your Kakao Talk Channel connected to your service app.

Providing a new API

We provide a new version for checking Kakao Talk Channel relationship API. You can find information of the v1 API in a separate document.

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.

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.

If you are an administrator, you can also use the app's Admin key to check the relationship between a Kakao Talk Channel and a specific user. When requesting using the app's Admin key and a service user ID, make a request from the service server by referring to the code snippet and parameters as follows. Make sure to use the app's Admin key only in the server.

Among Kakao Talk Channels that a user has added or blocked, only the channels connected to your service app return in the response in JSON format. Each channel object in the response contains detailed information, such as whether the user adds or blocks the Kakao Talk Channel currently and the time when the channel has been added or blocked.

In the following situations, permission-related error occurs:

  • If you set 'Kakao Talk Channel addition status and details' to 'Optional item', a user may not consent to the consent item. In this case, you can request consent from the user again by Requesting additional consent as needed.

Request: Using access token

Header
NameDescriptionRequired
AuthorizationAuthorization: Bearer ${ACCESS_TOKEN}
Access token as a type of user authentication.
O
Query parameter
NameTypeDescriptionRequired
channel_public_idsString[]List of Kakao Talk Channel profile IDs that you want to check the relationship with a user.O

Request: Using Service app admin key

Header
NameDescriptionRequired
AuthorizationAuthorization: KakaoAK ${SERVICE_APP_ADMIN_KEY}
Service app admin key as a type of user authentication.
O
Content-TypeContent-Type: application/x-www-form-urlencoded;charset=utf-8
The data type of the request.
O
Query parameter
NameTypeDescriptionRequired
target_id_typeStringA type of the user ID.
Fixed to user_id.
O
target_idLongService user ID.O
channel_public_idsString[]List of Kakao Talk Channel profile IDs that you want to check the relationship with a user.
(Default: A list of all Kakao Talk Channel profile IDs that connected to your service app)
X

Response

Body
NameTypeDescriptionRequired
user_idLongService user ID.O
channelsChannels[]Kakao Talk Channel information.X
Channels
NameTypeDescriptionRequired
channel_uuidStringKakao Talk Channel profile ID for search purpose.O
channel_public_idStringKakao Talk Channel profile ID.O
relationStringRelationship between a Kakao Talk Channel and a user.
ADDED: a user has added the channel.
BLOCKED: a user has blocked the channel.
NONE: a user has not either added or blocked the channel.
O
created_atDatetimeTime when a Kakao Talk Channel is added in UTC*.
Only returned if a Kakao Talk Channel is added (ADDED).
X
updated_atDatetimeTime when a Kakao Talk Channel relationship is changed in UTC*.
Only returned if a Kakao Talk Channel is added (ADDED) or blocked (BLOCKED).
X
*The time is based on Coordinated Universal Time(UTC), being 9 hours behind Korean Standard Time(KST). For the format of time, refer to RFC3339: Date and Time on the Internet.

Sample

Request: Using access token
curl -v -G GET "https://kapi.kakao.com/v1/api/talk/channels" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
--data-urlencode 'channel_public_ids=["_frxjem","_xnrxjem","_Brxjem"]'
Request: Using admin key
curl -v -G GET "https://kapi.kakao.com/v1/api/talk/channels" \
-H "Authorization: KakaoAK ${SERVICE_APP_ADMIN_KEY}" \
-d "target_id_type=user_id" \
-d "target_id={USER_ID}" \
--data-urlencode 'channel_public_ids=["_frxjem","_xnrxjem","_Brxjem"]'
Response: Success
HTTP/1.1 200 OK
{
"user_id": 1111111,
"channels": [
{
"channel_uuid": "@테스트",
"channel_public_id": "_ZeUTxl",
"relation": "ADDED", // One of ADDED, BLOCKED, NONE
"created_at": "2020-04-18T03:17:05Z", // Only returned when "relation" is "ADDED".
"updated_at": "2021-05-17T05:25:01Z"
}, // Only returned when "relation" is "ADDED" or "BLOCKED".
...
]
}
Response: Fail, if requesting for a non-Kakao Talk user
HTTP/1.1 400 Bad Request
{
"msg": "given account is not connected to any talk user.",
"code": -501
}

Was this helpful?