페이지 이동경로
  • 문서>
  • 카카오톡 메시지>
  • REST API

카카오톡 메시지

REST API

이 문서는 REST API를 사용한 카카오톡 메시지 API 구현 방법을 안내합니다.

이 문서에 포함된 기능 일부는 [도구] > [REST API 테스트]에서 사용해 볼 수 있습니다.

카카오톡 메시지 API는 같은 서비스 내 사용자간 메시지 발송만 지원하며, 카카오톡 소셜 API 사용 권한이 있어야 친구에게 메시지 발송 기능을 사용할 수 있습니다. 자세한 내용은 메시지 발송 기능 안내사용 방법을 확인합니다.

시작하기 전에

구현 방식 선택

보낼 메시지의 종류와 구성 방법에 따라 호출해야할 API가 다르므로, 개발 전 아래 순서대로 사용할 API를 선택합니다.

1. 메시지 발송 기능 선택하기

카카오디벨로퍼스의 메시지 발송 기능은 카카오톡 공유와 카카오톡 메시지 두 가지입니다. 메시지 발송 기능 안내를 참고해 사용할 기능을 선택합니다. 카카오톡 메시지를 사용하려는 경우, Step 2 이후의 내용을 확인합니다.

주의: 카카오톡 공유 미지원

카카오톡 공유 API는 REST API 방식을 지원하지 않습니다. 웹 페이지에서 카카오톡 공유 기능을 제공하려면 JavaScript SDK를 사용합니다.

2. 메시지 종류 및 구성 방법 선택하기

템플릿 종류를 참고하여 어떤 메시지 템플릿을 사용할지 결정합니다.

구성 방식 비교를 참고해 어떤 방식으로 메시지를 구성할지 결정합니다. 사전에 정의된 기본 템플릿을 바탕으로 JSON 형태로 구성하거나, 서비스에 맞게 직접 구성한 사용자 정의 템플릿 방식을 사용할 수 있습니다.

3. 메시지 전송 대상 선택하기

카카오톡 메시지의 경우, 수신 대상에 따라 사용하는 API가 구분되어 있다는 점에 유의합니다.

전송 대상 설명
에게 발송 현재 로그인한 사용자의 카카오톡 나와의 채팅에 메시지를 발송합니다. 이 기능으로는 다른 사용자에게 메시지를 보낼 수 없고, 로그인한 사용자 본인에게만 메시지를 보낼 수 있습니다.
친구에게 발송 현재 로그인한 사용자의 카카오톡 친구에게 메시지를 발송합니다. 피커 또는 카카오톡 친구 목록 조회 API로 수신 대상 정보를 받는 과정을 추가 구현해야 합니다. 한 번에 최대 5명의 친구에게 메시지를 보낼 수 있습니다. 일간 및 월간 제공량이 정해져 있으므로 쿼터를 참고합니다.
주의: 사용 권한

친구에게 발송하려는 경우, 사용 권한 신청이 필요합니다. 이용 정책을 함께 참고합니다.


나에게 기본 템플릿으로 메시지 발송

기본 정보
메서드 URL 인증 방식
POST https://kapi.kakao.com/v2/api/talk/memo/default/send 액세스 토큰
권한 사전 설정 카카오 로그인 동의항목
- 플랫폼 등록
카카오 로그인 활성화
동의항목
필요 필요:
카카오톡 메시지 전송(talk_message)

사전 정의된 템플릿 형식에 맞춰 JSON 형태로 구성 요소를 정의해 나에게 메시지를 발송하는 API입니다.

액세스 토큰을 헤더에 담아 POST로 요청합니다. JSON 형식으로 구성한 기본 템플릿을 template_object 파라미터로 전달해야 합니다. 자세한 메시지 구성 방법은 기본 템플릿을 참고합니다.

다른 사용자에게 발송이 필요하면 기본 템플릿으로 메시지 발송 API를 사용합니다.

요청

헤더
이름 설명 필수
Authorization Authorization: Bearer ${ACCESS_TOKEN}
인증 방식, 액세스 토큰으로 인증 요청
O
Content-Type Content-Type: application/x-www-form-urlencoded;charset=utf-8
요청 데이터 타입
O
본문
이름 타입 설명 필수
template_object Object 메시지 구성 요소를 담은 객체(Object)
피드, 리스트, 위치, 커머스, 텍스트, 캘린더 중 하나
O

응답

본문
이름 타입 설명 필수
result_code Integer 전송 성공 시 0 O

예제

요청
피드
리스트
위치
커머스
텍스트
캘린더
curl -v -X POST "https://kapi.kakao.com/v2/api/talk/memo/default/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'template_object={
        "object_type": "feed",
        "content": {
            "title": "오늘의 디저트",
            "description": "아메리카노, 빵, 케익",
            "image_url": "https://mud-kage.kakao.com/dn/NTmhS/btqfEUdFAUf/FjKzkZsnoeE4o19klTOVI1/openlink_640x640s.jpg",
            "image_width": 640,
            "image_height": 640,
            "link": {
                "web_url": "http://www.daum.net",
                "mobile_web_url": "http://m.daum.net",
                "android_execution_params": "contentId=100",
                "ios_execution_params": "contentId=100"
            }
        },
        "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원"
                },
                {
                    "item" :"Cake2",
                    "item_op" : "2000원"
                },
                {
                    "item" :"Cake3",
                    "item_op" : "3000원"
                },
                {
                    "item" :"Cake4",
                    "item_op" : "4000원"
                },
                {
                    "item" :"Cake5",
                    "item_op" : "5000원"
                }
            ],
            "sum" :"Total",
            "sum_op" : "15000원"
        },
        "social": {
            "like_count": 100,
            "comment_count": 200,
            "shared_count": 300,
            "view_count": 400,
            "subscriber_count": 500
        },
        "buttons": [
            {
                "title": "웹으로 이동",
                "link": {
                    "web_url": "http://www.daum.net",
                    "mobile_web_url": "http://m.daum.net"
                }
            },
            {
                "title": "앱으로 이동",
                "link": {
                    "android_execution_params": "contentId=100",
                    "ios_execution_params": "contentId=100"
                }
            }
        ]
    }'
curl -v -X POST "https://kapi.kakao.com/v2/api/talk/memo/default/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'template_object={
        "object_type": "list",
        "header_title": "WEEKELY MAGAZINE",
        "header_link": {
            "web_url": "http://www.daum.net",
            "mobile_web_url": "http://m.daum.net",
            "android_execution_params": "main",
            "ios_execution_params": "main"
        },
        "contents": [
            {
                "title": "자전거 라이더를 위한 공간",
                "description": "매거진",
                "image_url": "https://mud-kage.kakao.com/dn/QNvGY/btqfD0SKT9m/k4KUlb1m0dKPHxGV8WbIK1/openlink_640x640s.jpg",
                "image_width": 640,
                "image_height": 640,
                "link": {
                    "web_url": "http://www.daum.net/contents/1",
                    "mobile_web_url": "http://m.daum.net/contents/1",
                    "android_execution_params": "/contents/1",
                    "ios_execution_params": "/contents/1"
                }
            },
            {
                "title": "비쥬얼이 끝내주는 오레오 카푸치노",
                "description": "매거진",
                "image_url": "https://mud-kage.kakao.com/dn/boVWEm/btqfFGlOpJB/mKsq9z6U2Xpms3NztZgiD1/openlink_640x640s.jpg",
                "image_width": 640,
                "image_height": 640,
                "link": {
                    "web_url": "http://www.daum.net/contents/2",
                    "mobile_web_url": "http://m.daum.net/contents/2",
                    "android_execution_params": "/contents/2",
                    "ios_execution_params": "/contents/2"
                }
            },
            {
                "title": "감성이 가득한 분위기",
                "description": "매거진",
                "image_url": "https://mud-kage.kakao.com/dn/NTmhS/btqfEUdFAUf/FjKzkZsnoeE4o19klTOVI1/openlink_640x640s.jpg",
                "image_width": 640,
                "image_height": 640,
                "link": {
                    "web_url": "http://www.daum.net/contents/3",
                    "mobile_web_url": "http://m.daum.net/contents/3",
                    "android_execution_params": "/contents/3",
                    "ios_execution_params": "/contents/3"
                }
            }
        ],
        "buttons": [
            {
                "title": "웹으로 이동",
                "link": {
                    "web_url": "http://www.daum.net",
                    "mobile_web_url": "http://m.daum.net"
                }
            },
            {
                "title": "앱으로 이동",
                "link": {
                    "android_execution_params": "main",
                    "ios_execution_params": "main"
                }
            }
        ]
    }'
curl -v -X POST "https://kapi.kakao.com/v2/api/talk/memo/default/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'template_object={
            "object_type": "location",
            "content": {
                "title": "카카오 판교오피스",
                "description": "카카오 판교오피스 위치입니다.",
                "image_url": "https://mud-kage.kakao.com/dn/drTdbB/bWYf06POFPf/owUHIt7K7NoGD0hrzFLeW0/kakaolink40_original.png",
                "image_width": 800,
                "image_height": 800,
                "link": {
                    "web_url": "https://developers.kakao.com",
                    "mobile_web_url": "https://developers.kakao.com/mobile",
                    "android_execution_params": "platform=android",
                    "ios_execution_params": "platform=ios"
                }
            },
            "buttons": [
                {
                    "title": "웹으로 보기",
                    "link": {
                        "web_url": "https://developers.kakao.com",
                        "mobile_web_url": "https://developers.kakao.com/mobile"
                    }
                }
            ],
            "address": "경기 성남시 분당구 판교역로 235 에이치스퀘어 N동 7층",
            "address_title": "카카오 판교오피스"
        }'
curl -v -X POST "https://kapi.kakao.com/v2/api/talk/memo/default/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'template_object={
        "object_type": "commerce",
        "content": {
            "title": "Ivory long dress (4 Color)",
            "image_url": "https://mud-kage.kakao.com/dn/RY8ZN/btqgOGzITp3/uCM1x2xu7GNfr7NS9QvEs0/kakaolink40_original.png",
            "image_width": 640,
            "image_height": 640,
            "link": {
                "web_url": "https://style.kakao.com/main/women/contentId=100",
                "mobile_web_url": "https://style.kakao.com/main/women/contentId=100",
                "android_execution_params": "contentId=100",
                "ios_execution_params": "contentId=100"
            }
        },
        "commerce": {
            "regular_price": 208800,
            "discount_price": 146160,
            "discount_rate": 30
        },
        "buttons": [
            {
                "title": "구매하기",
                "link": {
                    "web_url": "https://style.kakao.com/main/women/contentId=100/buy",
                    "mobile_web_url": "https://style.kakao.com/main/women/contentId=100/buy",
                    "android_execution_params": "contentId=100&buy=true",
                    "ios_execution_params": "contentId=100&buy=true"
                }
            },
            {
                "title": "공유하기",
                "link": {
                    "web_url": "https://style.kakao.com/main/women/contentId=100/share",
                    "mobile_web_url": "https://style.kakao.com/main/women/contentId=100/share",
                    "android_execution_params": "contentId=100&share=true",
                    "ios_execution_params": "contentId=100&share=true"
                }
            }
        ]
    }'
curl -v -X POST "https://kapi.kakao.com/v2/api/talk/memo/default/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'template_object={
        "object_type": "text",
        "text": "텍스트 영역입니다. 최대 200자 표시 가능합니다.",
        "link": {
            "web_url": "https://developers.kakao.com",
            "mobile_web_url": "https://developers.kakao.com"
        },
        "button_title": "바로 확인"
    }'
curl -v -X POST "https://kapi.kakao.com/v2/api/talk/memo/default/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'template_object={
        "object_type": "calendar",
        "content": {
            "title": "일정 제목",
            "description": "일정 설명",
            "image_url": "https://developers.kakao.com/static/images/pc/txt_visual1.png",
            "link": {
                "web_url":"https://kakao.com"
            }
        },
        "buttons": [
            {
                "title": "일정 정보 보기",
                "link": {
                    "web_url": "https://developers.kakao.com",
                    "mobile_web_url": "https://developers.kakao.com/mobile"
                }
            }
        ],
        "id_type": "event",
        "id": "6351f57c7ec8e318d0b809a0"
    }'
응답
HTTP/1.1 200 OK
{
  "result_code": 0
}

나에게 사용자 정의 템플릿으로 메시지 발송

기본 정보
메서드 URL 인증 방식
POST https://kapi.kakao.com/v2/api/talk/memo/send 액세스 토큰
권한 사전 설정 카카오 로그인 동의항목
- 플랫폼 등록
카카오 로그인 활성화
동의항목
메시지 템플릿 등록
필요 필요:
카카오톡 메시지 전송(talk_message)

[도구] > [메시지 템플릿]에서 직접 구성한 사용자 정의 템플릿을 사용해 나에게 메시지를 발송하는 API입니다. 메시지 구성 방법은 사용자 정의 템플릿을 참고합니다.

액세스 토큰을 헤더에 담아 POST로 요청합니다. 사용자 정의 템플릿 ID를 template_id 파라미터로 전달해야 합니다.

다른 사용자에게 발송이 필요하면 사용자 정의 템플릿으로 메시지 발송 API를 사용합니다.

요청

헤더
이름 설명 필수
Authorization Authorization: Bearer ${ACCESS_TOKEN}
인증 방식, 액세스 토큰으로 인증 요청
O
본문
이름 타입 설명 필수
template_id String [도구] > [메시지 템플릿]에서 구성한 메시지 템플릿 ID
서비스에서 정의한 메시지 템플릿을 기반으로 메시지를 보낼 경우 사용
(참고: 사용자 정의 템플릿)
O
template_args Object template_id로 지정한 메시지 템플릿에 사용자 인자를 사용한 경우, 전달 필수
key:value 형식으로 전달
중요: 사용자 정의 템플릿에 사용자 인자를 사용했음에도 이 파라미터를 사용하지 않을 경우, 사용자 인자로 지정된 부분이 ${KEY} 형식으로 메시지에 그대로 노출
X

응답

본문
이름 타입 설명 필수
result_code Integer 전송 성공 시 0 O

예제

요청
curl -v -X POST "https://kapi.kakao.com/v2/api/talk/memo/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -d "template_id=12345" \
    -d 'template_args={"TITLE":"타이틀입니다."}'
응답
HTTP/1.1 200 OK
{
  "result_code":0
}

나에게 스크랩 메시지 발송

기본 정보
메서드 URL 인증 방식
POST https://kapi.kakao.com/v2/api/talk/memo/scrap/send 액세스 토큰
권한 사전 설정 카카오 로그인 동의항목
- 플랫폼 등록
카카오 로그인 활성화
동의항목
메시지 템플릿 등록 (사용자 정의 템플릿 사용 시)
필요 필요:
카카오톡 메시지 전송(talk_message)

웹 페이지 URL을 스크랩하여 그 정보를 바탕으로 스크랩 메시지를 구성해 나에게 발송하는 API입니다. 다른 사용자에게 발송이 필요하면 스크랩 메시지 발송 API를 사용합니다.

액세스 토큰을 헤더에 담아 POST로 요청합니다. 스크랩할 웹 페이지 URL을 request_url 파라미터로 전달해야 합니다. 스크랩할 웹 페이지의 도메인은 앱 관리 페이지의 [앱] > [일반] > [플랫폼] > [Web]에 등록돼 있어야 합니다.

요청

헤더
이름 설명 필수
Authorization Authorization: Bearer ${ACCESS_TOKEN}
인증 방식, 액세스 토큰으로 인증 요청
O
본문
이름 타입 설명 필수
request_url String 스크랩할 웹 페이지 URL
중요: 앱 관리 페이지의 [앱] > [일반] > [플랫폼] > [Web]에 등록된 도메인만 사용 가능
O
template_id String [도구] > [메시지 템플릿]에서 구성한 메시지 템플릿 ID
서비스에서 정의한 메시지 템플릿을 기반으로 스크랩 메시지를 보낼 경우 사용
(참고: 사용자 정의 템플릿)
X
template_args Object template_id로 지정한 메시지 템플릿에 사용자 인자를 사용한 경우, 전달 필수
key:value 형식으로 전달
스크랩 결과를 덮어쓰기(overwrite) 할 수는 없음
중요: 사용자 정의 템플릿에 사용자 인자를 사용했음에도 이 파라미터를 사용하지 않을 경우, 사용자 인자로 지정된 부분이 ${KEY} 형식으로 메시지에 그대로 노출
X

응답

본문
이름 타입 설명 필수
result_code Integer 전송 성공 시 0 O

예제

요청: 기본 템플릿 사용
curl -v -X POST "https://kapi.kakao.com/v2/api/talk/memo/scrap/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode "request_url=https://developers.kakao.com"
요청: 사용자 정의 템플릿 사용
curl -v -X POST "https://kapi.kakao.com/v2/api/talk/memo/scrap/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode "request_url=https://developers.kakao.com"
    -d "template_id=12345" \
    -d 'template_args={"TITLE":"타이틀입니다."}' \
응답
HTTP/1.1 200 OK
{
  "result_code":0
}

기본 템플릿으로 메시지 발송

기본 정보
메서드 URL 인증 방식
POST https://kapi.kakao.com/v1/api/talk/friends/message/default/send 액세스 토큰
권한 사전 설정 카카오 로그인 동의항목
필요:
사용 권한
플랫폼 등록
카카오 로그인 활성화
동의항목
필요 필요:
카카오톡 메시지 전송(talk_message)

사전 정의된 템플릿 형식에 맞춰 JSON 형태로 구성 요소를 정의해 메시지를 발송하는 API입니다.

액세스 토큰을 헤더에 담아 POST로 요청합니다. JSON 형식으로 구성한 기본 템플릿을 template_object 파라미터로 전달해야 합니다. 자세한 메시지 구성 방법은 기본 템플릿을 참고합니다.

요청

헤더
이름 설명 필수
Authorization Authorization: Bearer ${ACCESS_TOKEN}
인증 방식, 액세스 토큰으로 인증 요청
O
Content-Type Content-Type: application/x-www-form-urlencoded;charset=utf-8
요청 데이터 타입
O
본문
이름 타입 설명 필수
receiver_uuids String[] 피커 또는 카카오톡 친구 목록 조회 API로 얻은 사용자 uuid 값
한 번에 최대 5명의 사용자에게 메시지 발송 가능
O
template_object Object 메시지 구성 요소를 담은 객체(Object)
피드, 리스트, 위치, 커머스, 텍스트, 캘린더 중 하나
O

응답

본문
이름 타입 설명 필수
successful_receiver_uuids String[] 메시지 전송에 성공한 사용자 아이디(uuid) 배열 X
failure_info FailureInfo[] 실패 정보
요청 수신자가 2명 이상일 때 실패 시 "http status code: 200"과 함께 실패한 사용자 정보를 failure_info로 전달
요청 수신자가 1명일 때 실패 시 failure_info 없이 에러 코드로 전달
X
FailureInfo
이름 타입 설명 필수
code Integer 에러 코드 O
msg String 에러 메시지 O
receiver_uuids String[] 해당 에러 코드로 실패한 사용자 아이디(uuid) 배열 O

예제

요청
피드
리스트
위치
커머스
텍스트
캘린더
curl -v -X POST "https://kapi.kakao.com/v1/api/talk/friends/message/default/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'receiver_uuids=["abcdefg0001","abcdefg0002","abcdefg0003"]' \
    --data-urlencode 'template_object={
        "object_type": "feed",
        "content": {
            "title": "오늘의 디저트",
            "description": "아메리카노, 빵, 케익",
            "image_url": "https://mud-kage.kakao.com/dn/NTmhS/btqfEUdFAUf/FjKzkZsnoeE4o19klTOVI1/openlink_640x640s.jpg",
            "image_width": 640,
            "image_height": 640,
            "link": {
                "web_url": "http://www.daum.net",
                "mobile_web_url": "http://m.daum.net",
                "android_execution_params": "contentId=100",
                "ios_execution_params": "contentId=100"
            }
        },
        "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원"
                },
                {
                    "item" :"Cake2",
                    "item_op" : "2000원"
                },
                {
                    "item" :"Cake3",
                    "item_op" : "3000원"
                },
                {
                    "item" :"Cake4",
                    "item_op" : "4000원"
                },
                {
                    "item" :"Cake5",
                    "item_op" : "5000원"
                }
            ],
            "sum" :"Total",
            "sum_op" : "15000원"
        },
        "social": {
            "like_count": 100,
            "comment_count": 200,
            "shared_count": 300,
            "view_count": 400,
            "subscriber_count": 500
        },
        "buttons": [
            {
                "title": "웹으로 이동",
                "link": {
                    "web_url": "http://www.daum.net",
                    "mobile_web_url": "http://m.daum.net"
                }
            },
            {
                "title": "앱으로 이동",
                "link": {
                    "android_execution_params": "contentId=100",
                    "ios_execution_params": "contentId=100"
                }
            }
        ]
    }'
curl -v -X POST "https://kapi.kakao.com/v1/api/talk/friends/message/default/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'receiver_uuids=["abcdefg0001","abcdefg0002","abcdefg0003"]' \
    --data-urlencode 'template_object={
        "object_type": "list",
        "header_title": "WEEKELY MAGAZINE",
        "header_link": {
            "web_url": "http://www.daum.net",
            "mobile_web_url": "http://m.daum.net",
            "android_execution_params": "main",
            "ios_execution_params": "main"
        },
        "contents": [
            {
                "title": "자전거 라이더를 위한 공간",
                "description": "매거진",
                "image_url": "https://mud-kage.kakao.com/dn/QNvGY/btqfD0SKT9m/k4KUlb1m0dKPHxGV8WbIK1/openlink_640x640s.jpg",
                "image_width": 640,
                "image_height": 640,
                "link": {
                    "web_url": "http://www.daum.net/contents/1",
                    "mobile_web_url": "http://m.daum.net/contents/1",
                    "android_execution_params": "/contents/1",
                    "ios_execution_params": "/contents/1"
                }
            },
            {
                "title": "비쥬얼이 끝내주는 오레오 카푸치노",
                "description": "매거진",
                "image_url": "https://mud-kage.kakao.com/dn/boVWEm/btqfFGlOpJB/mKsq9z6U2Xpms3NztZgiD1/openlink_640x640s.jpg",
                "image_width": 640,
                "image_height": 640,
                "link": {
                    "web_url": "http://www.daum.net/contents/2",
                    "mobile_web_url": "http://m.daum.net/contents/2",
                    "android_execution_params": "/contents/2",
                    "ios_execution_params": "/contents/2"
                }
            },
            {
                "title": "감성이 가득한 분위기",
                "description": "매거진",
                "image_url": "https://mud-kage.kakao.com/dn/NTmhS/btqfEUdFAUf/FjKzkZsnoeE4o19klTOVI1/openlink_640x640s.jpg",
                "image_width": 640,
                "image_height": 640,
                "link": {
                    "web_url": "http://www.daum.net/contents/3",
                    "mobile_web_url": "http://m.daum.net/contents/3",
                    "android_execution_params": "/contents/3",
                    "ios_execution_params": "/contents/3"
                }
            }
        ],
        "buttons": [
            {
                "title": "웹으로 이동",
                "link": {
                    "web_url": "http://www.daum.net",
                    "mobile_web_url": "http://m.daum.net"
                }
            },
            {
                "title": "앱으로 이동",
                "link": {
                    "android_execution_params": "main",
                    "ios_execution_params": "main"
                }
            }
        ]
    }'
curl -v -X POST "https://kapi.kakao.com/v1/api/talk/friends/message/default/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'receiver_uuids=["abcdefg0001","abcdefg0002","abcdefg0003"]' \
    --data-urlencode 'template_object={
        "object_type": "location",
        "content": {
            "title": "카카오 판교오피스",
            "description": "카카오 판교오피스 위치입니다.",
            "image_url": "https://mud-kage.kakao.com/dn/drTdbB/bWYf06POFPf/owUHIt7K7NoGD0hrzFLeW0/kakaolink40_original.png",
            "image_width": 800,
            "image_height": 800,
            "link": {
                "web_url": "https://developers.kakao.com",
                "mobile_web_url": "https://developers.kakao.com/mobile",
                "android_execution_params": "platform=android",
                "ios_execution_params": "platform=ios"
            }
        },
        "buttons": [
            {
                "title": "웹으로 보기",
                "link": {
                    "web_url": "https://developers.kakao.com",
                    "mobile_web_url": "https://developers.kakao.com/mobile"
                }
            }
        ],
        "address": "경기 성남시 분당구 판교역로 235 에이치스퀘어 N동 7층",
        "address_title": "카카오 판교오피스"
    }'
curl -v -X POST "https://kapi.kakao.com/v1/api/talk/friends/message/default/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'receiver_uuids=["abcdefg0001","abcdefg0002","abcdefg0003"]' \
    --data-urlencode 'template_object={
        "object_type": "commerce",
        "content": {
            "title": "Ivory long dress (4 Color)",
            "image_url": "https://mud-kage.kakao.com/dn/RY8ZN/btqgOGzITp3/uCM1x2xu7GNfr7NS9QvEs0/kakaolink40_original.png",
            "image_width": 640,
            "image_height": 640,
            "link": {
                "web_url": "https://style.kakao.com/main/women/contentId=100",
                "mobile_web_url": "https://style.kakao.com/main/women/contentId=100",
                "android_execution_params": "contentId=100",
                "ios_execution_params": "contentId=100"
            }
        },
        "commerce": {
            "regular_price": 208800,
            "discount_price": 146160,
            "discount_rate": 30
        },
        "buttons": [
            {
                "title": "구매하기",
                "link": {
                    "web_url": "https://style.kakao.com/main/women/contentId=100/buy",
                    "mobile_web_url": "https://style.kakao.com/main/women/contentId=100/buy",
                    "android_execution_params": "contentId=100&buy=true",
                    "ios_execution_params": "contentId=100&buy=true"
                }
            },
            {
                "title": "공유하기",
                "link": {
                    "web_url": "https://style.kakao.com/main/women/contentId=100/share",
                    "mobile_web_url": "https://style.kakao.com/main/women/contentId=100/share",
                    "android_execution_params": "contentId=100&share=true",
                    "ios_execution_params": "contentId=100&share=true"
                }
            }
        ]
    }'
curl -v -X POST "https://kapi.kakao.com/v1/api/talk/friends/message/default/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'receiver_uuids=["abcdefg0001","abcdefg0002","abcdefg0003"]' \
    --data-urlencode 'template_object={
        "object_type": "text",
        "text": "텍스트 영역입니다. 최대 200자 표시 가능합니다.",
        "link": {
            "web_url": "https://developers.kakao.com",
            "mobile_web_url": "https://developers.kakao.com"
        },
        "button_title": "바로 확인"
    }'
curl -v -X POST "https://kapi.kakao.com/v1/api/talk/friends/message/default/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'receiver_uuids=["abcdefg0001","abcdefg0002","abcdefg0003"]' \
    --data-urlencode 'template_object={
        "object_type": "calendar",
        "content": {
            "title": "일정 제목",
            "description": "일정 설명",
            "image_url": "https://developers.kakao.com/static/images/pc/txt_visual1.png",
            "link": {
                "web_url":"https://kakao.com"
            }
        },
        "buttons": [
            {
                "title": "일정 정보 보기",
                "link": {
                    "web_url": "https://developers.kakao.com",
                    "mobile_web_url": "https://developers.kakao.com/mobile"
                }
            }
        ],
        "id_type": "event",
        "id": "6351f57c7ec8e318d0b809a0"
    }'
응답: 모든 친구에게 발송 성공
HTTP/1.1 200 OK
{
  "successful_receiver_uuids": ["abcdefg0001","abcdefg0002","abcdefg0003"]
}
응답: 일부 친구에게만 전송 성공
HTTP/1.1 200 OK
{
  "successful_receiver_uuids": ["abcdefg0001","abcdefg0002"],
  "failure_info":[{
      "code": -532,
      "msg": "daily message limit per sender has been exceeded.",
      "receiver_uuids": ["abcdefg0003"]
  }]
}

사용자 정의 템플릿으로 메시지 발송

기본 정보
메서드 URL 인증 방식
POST https://kapi.kakao.com/v1/api/talk/friends/message/send 액세스 토큰
권한 사전 설정 카카오 로그인 동의항목
필요:
사용 권한
플랫폼 등록
카카오 로그인 활성화
동의항목
메시지 템플릿 등록
필요 필요:
카카오톡 메시지 전송(talk_message)

[도구] > [메시지 템플릿]에서 직접 구성한 사용자 정의 템플릿을 사용해 메시지를 발송하는 API입니다. 메시지 구성 방법은 사용자 정의 템플릿을 참고합니다.

액세스 토큰을 헤더에 담아 POST로 요청합니다. 사용자 정의 템플릿 ID를 template_id 파라미터로 전달해야 합니다.

요청

헤더
이름 설명 필수
Authorization Authorization: Bearer ${ACCESS_TOKEN}
인증 방식, 액세스 토큰으로 인증 요청
O
본문
이름 타입 설명 필수
receiver_uuids String[] 피커 또는 카카오톡 친구 목록 조회 API로 얻은 사용자 uuid 값, 최대 5개 O
template_id String [도구] > [메시지 템플릿]에서 구성한 메시지 템플릿 ID
서비스에서 정의한 메시지 템플릿을 기반으로 메시지를 보낼 경우 사용
(참고: 사용자 정의 템플릿)
O
template_args Object template_id로 지정한 메시지 템플릿에 사용자 인자를 사용한 경우, 전달 필수
key:value 형식으로 전달
중요: 사용자 정의 템플릿에 사용자 인자를 사용했음에도 이 파라미터를 사용하지 않을 경우, 사용자 인자로 지정된 부분이 ${KEY} 형식으로 메시지에 그대로 노출
X

응답

본문
이름 타입 설명 필수
successful_receiver_uuids String[] 메시지 전송에 성공한 사용자 아이디(uuid) 배열 X
failure_info FailureInfo[] 실패 정보
요청 수신자가 2명 이상일 때 실패 시 "http status code: 200"과 함께 실패한 사용자 정보를 failure_info로 전달
요청 수신자가 1명일 때 실패 시 failure_info 없이 에러 코드로 전달
X
FailureInfo
이름 타입 설명 필수
code Integer 에러 코드 O
msg String 에러 메시지 O
receiver_uuids String[] 해당 에러 코드로 실패한 사용자 아이디(uuid) 배열 O

예제

요청
curl -v -X POST "https://kapi.kakao.com/v1/api/talk/friends/message/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -d "template_id=12345" \
    -d 'template_args={"TITLE":"타이틀입니다."}'
    --data-urlencode 'receiver_uuids=["abcdefg0001","abcdefg0002","abcdefg0003"]' 
응답: 모든 친구에게 발송 성공
HTTP/1.1 200 OK
{
  "successful_receiver_uuids": ["abcdefg0001","abcdefg0002","abcdefg0003"]
}
응답: 일부 친구에게만 전송 성공
HTTP/1.1 200 OK
{
  "successful_receiver_uuids": ["abcdefg0001","abcdefg0002"],
  "failure_info":[{
      "code": -532,
      "msg": "daily message limit per sender has been exceeded.",
      "receiver_uuids": ["abcdefg0003"]
  }]
}

스크랩 메시지 발송

기본 정보
메서드 URL 인증 방식
POST https://kapi.kakao.com/v1/api/talk/friends/message/scrap/send 액세스 토큰
권한 사전 설정 카카오 로그인 동의항목
필요:
사용 권한
플랫폼 등록
카카오 로그인 활성화
동의항목
메시지 템플릿 등록 (사용자 정의 템플릿 사용 시)
필요 필요:
카카오톡 메시지 전송(talk_message)

웹 페이지 URL을 스크랩하여 그 정보를 바탕으로 스크랩 메시지를 구성해 발송하는 API입니다.

액세스 토큰을 헤더에 담아 POST로 요청합니다. 스크랩할 웹 페이지 URL을 request_url 파라미터로 전달해야 합니다. 스크랩할 웹 페이지의 도메인은 앱 관리 페이지의 [앱] > [일반] > [플랫폼] > [Web]에 등록돼 있어야 합니다.

요청

헤더
이름 설명 필수
Authorization Authorization: Bearer ${ACCESS_TOKEN}
인증 방식, 액세스 토큰으로 인증 요청
O
본문
이름 타입 설명 필수
receiver_uuids String[] 피커 또는 카카오톡 친구 목록 조회 API로 얻은 사용자 ID(uuid) 값
한 번에 최대 5명의 사용자에게 메시지 발송 가능
O
request_url String 스크랩할 웹 페이지 URL
중요: 앱 관리 페이지의 [앱] > [일반] > [플랫폼] > [Web]에 등록된 도메인만 사용 가능
O
template_id String [도구] > [메시지 템플릿]에서 구성한 메시지 템플릿 ID
서비스에서 정의한 메시지 템플릿을 기반으로 스크랩 메시지를 보낼 경우 사용
(참고: 사용자 정의 템플릿)
X
template_args Object template_id로 지정한 메시지 템플릿에 사용자 인자를 사용한 경우, 전달 필수
key:value 형식으로 전달
스크랩 결과를 덮어쓰기(overwrite) 할 수는 없음
중요: 사용자 정의 템플릿에 사용자 인자를 사용했음에도 이 파라미터를 사용하지 않을 경우, 사용자 인자로 지정된 부분이 ${KEY} 형식으로 메시지에 그대로 노출
X

응답

본문
이름 타입 설명 필수
successful_receiver_uuids String[] 메시지 전송에 성공한 사용자 아이디(uuid) 배열 X
failure_info FailureInfo[] 실패 정보
요청 수신자가 2명 이상일 때 실패 시 "http status code: 200"과 함께 실패한 사용자 정보를 failure_info로 전달
요청 수신자가 1명일 때 실패 시 failure_info 없이 에러 코드로 전달
X
FailureInfo
이름 타입 설명 필수
code Integer 에러 코드 O
msg String 에러 메시지 O
receiver_uuids String[] 해당 에러 코드로 실패한 사용자 아이디(uuid) 배열 O

예제: 기본 템플릿 사용

curl -v -X POST "https://kapi.kakao.com/v1/api/talk/friends/message/scrap/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'receiver_uuids=["abcdefg0001","abcdefg0002","abcdefg0003"]' \
    --data-urlencode "request_url=https://developers.kakao.com"

예제: 사용자 정의 템플릿 사용

curl -v -X POST "https://kapi.kakao.com/v1/api/talk/friends/message/scrap/send" \
    -H "Content-Type: application/x-www-form-urlencoded;charset=utf-8" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    --data-urlencode 'receiver_uuids=["abcdefg0001","abcdefg0002","abcdefg0003"]' \
    --data-urlencode "request_url=https://developers.kakao.com" \
    -d "template_id=12345" \
    -d 'template_args={"TITLE":"타이틀입니다."}' \
응답: 성공
HTTP/1.1 200 OK
{
  "successful_receiver_uuids": ["abcdefg0001","abcdefg0002","abcdefg0003"]
}
응답: 일부 사용자에게 전송 실패
HTTP/1.1 200 OK
{
  "successful_receiver_uuids": ["abcdefg0001","abcdefg0002"],
  "failure_info":[{
      "code": -532,
      "msg": "daily message limit per sender has been exceeded.",
      "receiver_uuids": ["abcdefg0003"]
  }]
}

더 보기