페이지 이동경로
  • Docs>
  • Kakao Talk Channel

Kakao Talk Channel

REST API

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

Check Kakao Talk Channel relationship

Basic information
Method URL Authorization
GET https://kapi.kakao.com/v1/api/talk/channels Access token
Service app admin key
Permission Prerequisite Kakao Login User consent
Required Register platforms
Activate Kakao Login
Manage consent items
Set Kakao Talk Channel
Required Required:
Kakao Talk Channel addition status and details
IMPORTANT: 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.

Note

To get an alarm when a user adds or blocks your Kakao Talk Channel, use Kakao Talk Channel callback.

This API enables you to check if 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.

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:

Request: Using access token a id="check-relationship-request-access-token">

Header
Name Description Required
Authorization Authorization: Bearer ${ACCESS_TOKEN}
Access token as a type of user authentication.
O
Query parameter
Name Type Description Required
channel_public_ids String[] 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
Name Description Required
Authorization Authorization: KakaoAK ${SERVICE_APP_ADMIN_KEY}
Service app admin key as a type of user authentication.
O
Query parameter
Name Type Description Required
target_id_type String A type of the user ID.
Fixed to user_id.
O
target_id Long Service user ID. O
channel_public_ids String[] 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
Name Type Description Required
user_id Long Service user ID. O
channels Channels[] Kakao Talk Channel information. X
Channels
Name Type Description Required
channel_uuid String Kakao Talk Channel profile ID for search purpose. O
channel_public_id String Kakao Talk Channel profile ID. O
relation String Relationship 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_at Datetime Time when a Kakao Talk Channel is added in UTC*.
Only returned if a Kakao Talk Channel is added (ADDED).
X
updated_at Datetime Time 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
}