Namespace: Link

Kakao. Link

카카오링크와 관련된 함수들이 포함되어 있습니다.

Methods


<static> cleanup()

카카오 링크 전송과 관련된 리소스를 해제합니다.


<static> createCustomButton(settings)

원하는 형태의 메시지 템플릿을 만든 후 전송합니다. 메시지 템플릿 가이드로 이동

Parameters:
Name Type Description
settings Object

카카오링크와 관련된 설정을 key/value로 전달합니다.

Properties
Name Type Argument Default Description
container String | HTMLElement

DOM Element 또는 Element의 ID Selector를 넘기면, 해당 Element를 클릭할 때 카카오링크가 전송됩니다.

templateId Number

메시지 아이디, [앱 설정] - [메시지 템플릿 v2] 확인

templateArgs Object <optional>

메시지에 전달할 Argument, ex) {'name':'kakao', 'url':'https://developers.kakao.com'}

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동

See:

<static> createDefaultButton(settings)

링크 타입(Feed, Link, Location)에 맞는 Object를 구성하여 링크를 쉽게 전송할 수 있습니다.

Parameters:
Name Type Description
settings DefaultButtonFeedSettings | DefaultButtonListSettings | DefaultButtonLocationSettings | DefaultButtonCommerceSettings | DefaultButtonTextSettings

카카오링크와 관련된 설정을 key/value로 전달합니다.

See:

<static> createScrapButton(settings)

사이트의 메타 정보를 활용하여 링크를 전송합니다.

Parameters:
Name Type Description
settings Object

카카오링크와 관련된 설정을 key/value로 전달합니다.

Properties
Name Type Argument Default Description
container String | HTMLElement

DOM Element 또는 Element의 ID Selector를 넘기면, 해당 Element를 클릭할 때 카카오링크가 전송됩니다.

requestUrl String

스크랩 할 사이트 URL, 해당 사이트의 메타 정보를 토대로 링크를 생성

templateId Number <optional>

메시지 아이디, [앱 설정] - [메시지 템플릿 v2] 확인

templateArgs Object <optional>

메시지에 전달할 Argument, ex) {'name':'kakao', 'url':'https://developers.kakao.com'}

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동

See:

<static> deleteImage(settings)

삭제할 이미지의 경로를 전달하면 이미지를 삭제할 수 있습니다.

Parameters:
Name Type Description
settings Object

카카오링크 이미지와 관련된 설정을 key/value로 전달합니다.

Properties
Name Type Description
imageUrl String

삭제할 이미지 URL

Returns:
Type
Promise

<static> scrapImage(settings)

스크랩 하고 싶은 이미지의 경로를 전달하면 스크랩 후 업로드 합니다. (이미지는 20일 동안 보관됩니다.)

Parameters:
Name Type Description
settings Object

카카오링크 이미지와 관련된 설정을 key/value로 전달합니다.

Properties
Name Type Description
imageUrl String

스크랩할 이미지 URL

Returns:
Type
Promise.<ImageInfos>

<static> sendCustom(settings)

원하는 형태의 메시지 템플릿을 만든 후 전송합니다. 메시지 템플릿 가이드로 이동

Parameters:
Name Type Description
settings Object

카카오링크와 관련된 설정을 key/value로 전달합니다.

Properties
Name Type Argument Default Description
templateId Number

메시지 아이디, [앱 설정] - [메시지 템플릿 v2] 확인

templateArgs Object <optional>

메시지에 전달할 Argument, ex) {'name':'kakao', 'url':'https://developers.kakao.com'}

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동

See:

<static> sendDefault(settings)

링크 타입(Feed, Link, Location)에 맞는 Object를 구성하여 링크를 쉽게 전송할 수 있습니다.

Parameters:
Name Type Description
settings DefaultFeedSettings | DefaultListSettings | DefaultLocationSettings | DefaultCommerceSettings | DefaultTextSettings

카카오링크와 관련된 설정을 key/value로 전달합니다.

See:

<static> sendScrap(settings)

사이트의 메타 정보를 활용하여 링크를 전송합니다.

Parameters:
Name Type Description
settings Object

카카오링크와 관련된 설정을 key/value로 전달합니다.

Properties
Name Type Argument Default Description
container String | HTMLElement

DOM Element 또는 Element의 ID Selector를 넘기면, 해당 Element를 클릭할 때 카카오링크가 전송됩니다.

requestUrl String

스크랩 할 사이트 URL, 해당 사이트의 메타 정보를 토대로 링크를 생성

templateId Number <optional>

메시지 아이디, [앱 설정] - [메시지 템플릿 v2] 확인

templateArgs Object <optional>

메시지에 전달할 Argument, ex) {'name':'kakao', 'url':'https://developers.kakao.com'}

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동

See:

<static> uploadImage(settings)

카카오링크에 필요한 이미지를 업로드 합니다. (이미지는 20일 동안 보관됩니다.)

Parameters:
Name Type Description
settings Object

카카오링크 이미지와 관련된 설정을 key/value로 전달합니다.

Properties
Name Type Description
file FileList

HTMLInputElement의 files property

Returns:
Type
Promise.<ImageInfos>

Type Definitions


ButtonObject

메시지 하단에 추가되는 버튼 오브젝트입니다.

Type:
  • Object
Properties:
Name Type Description
title String

버튼의 타이틀

link LinkObject

버튼 클릭 시 이동할 링크 정보


CommerceObject

가격 정보를 표현하기 위해 사용되는 오브젝트입니다.

Type:
  • Object
Properties:
Name Type Argument Description
regularPrice Number

정상가격

discountPrice Number <optional>

할인된 가격

discountRate Number <optional>

할인율

fixedDiscountPrice Number <optional>

정액 할인 가격, 할인율과 동시 사용불가


ContentObject

콘텐츠의 내용을 담고 있는 오브젝트입니다.

Type:
  • Object
Properties:
Name Type Argument Description
title String

콘텐츠의 타이틀

imageUrl String

콘텐츠의 이미지 URL

link LinkObject

콘텐츠 클릭 시 이동할 링크 정보

imageWidth Number <optional>

콘텐츠의 이미지 너비 (단위: 픽셀)

imageHeight Number <optional>

콘텐츠의 이미지 높이 (단위: 픽셀)

description String <optional>

콘텐츠의 상세 설명


DefaultButtonCommerceSettings

Type:
  • Object
Properties:
Name Type Argument Default Description
objectType String

고정값 "commerce"

content ContentObject

메인 콘텐츠

commerce CommerceObject

가격 정보

buttonTitle String <optional>

버튼명, [앱 설정]에 따른 기본 링크 사용, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

buttons Array.<ButtonObject> <optional>

버튼, 링크 설정 가능, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동


DefaultButtonFeedSettings

Type:
  • Object
Properties:
Name Type Argument Default Description
container String | HTMLElement

DOM Element 또는 Element의 ID Selector를 넘기면, 해당 Element를 클릭할 때 카카오링크가 전송됩니다.

objectType String

고정값 "feed"

contents ContentObject

메인 콘텐츠

social SocialObject <optional>

소셜 정보

buttonTitle String <optional>

버튼명, [앱 설정]에 따른 기본 링크 사용, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

buttons Array.<ButtonObject> <optional>

버튼, 링크 설정 가능, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동


DefaultButtonListSettings

Type:
  • Object
Properties:
Name Type Argument Default Description
objectType String

고정값 "list"

headerTitle String

헤더 타이틀

headerLink LinkObject

헤더 링크

contents Array.<ContentObject>

메인 콘텐츠

buttonTitle String <optional>

버튼명, [앱 설정]에 따른 기본 링크 사용, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

buttons Array.<ButtonObject> <optional>

버튼, 링크 설정 가능, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동


DefaultButtonLocationSettings

Type:
  • Object
Properties:
Name Type Argument Default Description
objectType String

고정값 "location"

content ContentObject

메인 콘텐츠

address String

지도 뷰에서 사용 할 주소, ex.성남시 분당구 판교역로 235

addressTitle String <optional>

지도 뷰에서 사용될 주소명, ex.카카오 본사

social SocialObject <optional>

소셜 정보

buttonTitle String <optional>

버튼명, [앱 설정]에 따른 기본 링크 사용, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

buttons Array.<ButtonObject> <optional>

버튼, 링크 설정 가능, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동


DefaultButtonTextSettings

Type:
  • Object
Properties:
Name Type Argument Default Description
objectType String

고정값 "text"

text String

최대 200자의 텍스트

buttonTitle String <optional>

버튼명, [앱 설정]에 따른 기본 링크 사용, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

buttons Array.<ButtonObject> <optional>

버튼, 링크 설정 가능, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동


DefaultCommerceSettings

Type:
  • Object
Properties:
Name Type Argument Default Description
objectType String

고정값 "commerce"

content ContentObject

메인 콘텐츠

commerce CommerceObject

가격 정보

buttonTitle String <optional>

버튼명, [앱 설정]에 따른 기본 링크 사용, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

buttons Array.<ButtonObject> <optional>

버튼, 링크 설정 가능, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동


DefaultFeedSettings

Type:
  • Object
Properties:
Name Type Argument Default Description
objectType String

고정값 "feed"

contents ContentObject

메인 콘텐츠

social SocialObject <optional>

소셜 정보

buttonTitle String <optional>

버튼명, [앱 설정]에 따른 기본 링크 사용, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

buttons Array.<ButtonObject> <optional>

버튼, 링크 설정 가능, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동


DefaultListSettings

Type:
  • Object
Properties:
Name Type Argument Default Description
objectType String

고정값 "list"

headerTitle String

헤더 타이틀

headerLink LinkObject

헤더 링크

contents Array.<ContentObject>

메인 콘텐츠

buttonTitle String <optional>

버튼명, [앱 설정]에 따른 기본 링크 사용, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

buttons Array.<ButtonObject> <optional>

버튼, 링크 설정 가능, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동


DefaultLocationSettings

Type:
  • Object
Properties:
Name Type Argument Default Description
objectType String

고정값 "location"

content ContentObject

메인 콘텐츠

address String

지도 뷰에서 사용 할 주소, ex.성남시 분당구 판교역로 235

addressTitle String <optional>

지도 뷰에서 사용될 주소명, ex.카카오 본사

social SocialObject <optional>

소셜 정보

buttonTitle String <optional>

버튼명, [앱 설정]에 따른 기본 링크 사용, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

buttons Array.<ButtonObject> <optional>

버튼, 링크 설정 가능, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동


DefaultTextSettings

Type:
  • Object
Properties:
Name Type Argument Default Description
objectType String

고정값 "text"

text String

최대 200자의 텍스트

buttonTitle String <optional>

버튼명, [앱 설정]에 따른 기본 링크 사용, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

buttons Array.<ButtonObject> <optional>

버튼, 링크 설정 가능, buttonTitle과 buttons 함께 있을 경우 buttons가 적용됨

installTalk Boolean <optional>
false

카카오톡이 설치되어 있지 않은 경우 마켓의 카카오톡 설치 페이지로 이동합니다.

callback function <optional>

카카오링크 웹공유에서 공유 버튼 클릭 시 호출되는 콜백 함수 (IE 제외)

serverCallbackArgs Object | String <optional>

카카오링크 공유 시 전송되는 링크 콜백에 포함되는 파라미터. 링크 콜백 가이드로 이동


ImageInfos

이미지 정보

Properties:
Name Type Description
original Object
Properties
Name Type Description
url String

이미지 Full URL

length Number

이미지 사이즈, 단위: Byte

content_type String

이미지 포맷

width Number

이미지 가로 크기

height Number

이미지 세로 크기


LinkObject

메시지에서 콘텐츠 영역이나 버튼 클릭 시에 이동되는 링크 정보 오브젝트입니다. 오브젝트 내 프로퍼티 중 하나 이상은 반드시 존재해야 합니다.

Type:
  • Object
Properties:
Name Type Argument Description
webUrl String <optional>

PC버전 카카오톡에서 사용하는 웹 링크 URL

mobileWebUrl String <optional>

모바일 카카오톡에서 사용하는 웹 링크 URL

androidExecParams String <optional>

안드로이드 카카오톡에서 사용하는 앱 링크 URL에 사용될 파라미터

iosExecParams String <optional>

iOS 카카오톡에서 사용하는 앱 링크 URL에 사용될 파라미터


SocialObject

좋아요 수, 댓글 수 등의 소셜 정보를 표현하기 위해 사용되는 오브젝트입니다.

Type:
  • Object
Properties:
Name Type Argument Description
likeCount Number <optional>

콘텐츠의 좋아요 수

commentCount Number <optional>

콘텐츠의 댓글 수

sharedCount Number <optional>

콘텐츠의 공유 수

viewCount Number <optional>

콘텐츠의 조회 수

subscriberCount Number <optional>

콘텐츠의 구독 수