This document describes how to integrate Kakao Talk Social APIs into your service with the Kakao SDK for JavaScript ("JavaScript SDK").
Reference | App setting |
---|---|
Kakao.API.request() |
Install Initialize |
Permission | Prerequisite | Kakao Login | User consent |
---|---|---|---|
- | Register platforms Activate Kakao Login Manage consent items |
Required | Required: Profile Info(nickname/profile image) Nickname Profile image |
This API enables you to get the Kakao Talk profile of the user currently logged in. Note that Kakao Talk profiles may be different from Kakao Account profiles. Refer to Concepts.
Call the Kakao.API.request()
function, and set url
to /v1/api/talk/profile
to request Kakao Talk profile.
Name | Type | Description | Required |
---|---|---|---|
url | String |
Fixed to '/v1/api/talk/friends' . |
O |
Kakao.API.request()
returns Promise
. If the promise is fulfilled, the Kakao Talk profile information is returned. For the detailed response fields, refer to REST API > Retrieve Kakao Talk profile.
Kakao.API.request({
url: '/v1/api/talk/profile',
})
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
});
Reference | App setting |
---|---|
selectFriend() selectFriends() SelectedUser |
Install Initialize Set up for hybrid app(For popup) |
Permission | Prerequisite | Kakao Login | User consent |
---|---|---|---|
Required | Register platforms Activate Kakao Login Manage consent items |
Required | Required: Friends List in Kakao Service(Including profile image, nickname, and favorites) |
This API displays the Friend picker and provides the information of the Kakao Talk friends that a user selects through the picker.
Call one of the following functions depends on the selection type.
Selection type | Function to use |
---|---|
Single picker | selectFriend() |
Multi-picker | selectFriends() |
The components can be set by parameters.
Kakao.Picker.selectFriends()
returns Promise
. If the promise is fulfilled, the information of the friends that a user selects from the Friend picker is returned through SelectedUsers
.
Kakao.Picker.selectFriend({
title: 'Select friends',
})
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
});
Kakao.Picker.selectFriends({
title: 'Select friends',
maxPickableCount: 10,
minPickableCount: 1,
})
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
});
To call the friend picker on the current web page, use returnUrl
parameter.
Specify the URL of the service server that processes the response to the returnUrl
parameter. returnUrl
must be one of the site domains in [My Application] > [Platform] > [Web]. Use the enableBackButton
parameter to disable the back button.
When the user completes choosing friends, the web page will HTTP 302 redirect with the response as an encoded query string to the returnUrl
.
// Redirect method
// Success: ${returnUrl}?selected=${SelectedUsers}
// Fail: ${returnUrl}?error=${Error}
Kakao.Picker.selectFriends({
returnUrl: 'https://developers.kakao.com', // Required
title: 'Select friends',
maxPickableCount: 10,
minPickableCount: 1,
});
Reference | App setting |
---|---|
Kakao.API.request() |
Install Initialize |
Permission | Prerequisite | Kakao Login | User consent |
---|---|---|---|
Required | Register platforms Activate Kakao Login Manage consent items |
Required | Required: Friends List in Kakao Service (Including profile image, nickname, and favorites) |
You can get the list of Kakao Talk friends of the user currently logged in. You can also add optional parameters for sort order, the number of friends to be retrieved on a page, and so on.
Call the Kakao.API.request()
function, and set url
to /v1/api/talk/friends
to request Kakao Talk friends information.
Name | Type | Description | Required |
---|---|---|---|
url | String |
Fixed to '/v1/api/talk/friends' . |
O |
data | Object |
Object that contains the parameters to be passed when requesting the API. | X |
Name | Type | Description | Required |
---|---|---|---|
offset | Number |
Offset value that the list of friends starts from. (Default: 0 ) |
X |
limit | Number |
Maximum number of friends to be retrieved per page. (Maximum: 100 , Default: 10 ) |
X |
order | String |
Sort order of friends list. asc or desc . - asc : sort in ascending order.- desc : sort in descending order. (Default: asc ) |
X |
friend_order | String |
You can sort friends in the list by nickname (Kakao Talk nickname) or favorite (favorite friends). (Default: favorite ) |
X |
Kakao.API.request()
returns Promise
. If the promise is fulfilled, a list of friends is returned. For the detailed response fields, refer to REST API > Retrieve list of friends.
If the promise is rejected because the user has not agreed to provide the Friends list, proceed the followings:
Kakao.API.request({
url: '/v1/api/talk/friends',
})
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
});