페이지 이동경로
  • Docs>
  • Kakao Sync>
  • Check user agreed terms

Kakao Sync

Check user agreed terms

This API enables you to check which terms a user has consented to when the user logs in.

Kakao Sync Simple Sign up functions to get consent to the Terms of Service and the Provision of personal information from users through User Interface(UI) that the Kakao platform provides.

The terms you registered when applying Kakao Sync are displayed on the Consent screen when users log in through Simple Signup to ask for consent.

However, when you map the Kakao Accounts of users onto the existing accounts, the terms that have been consented by each account may differ. For this case, you can use the Checking the agreed terms API.

The registered terms have their own tags, so you can use the tags to check which terms you need to request consent to. Compare the tags of the terms to which a user has consented in the response with all tags. As required, implement a process to request consent internally in your service.

Process of obtaining consent to the terms that have not been agreed

You can test this feature in [Tools] > [REST API Test].

Tag used in this document

Tag Description
Login required The API marked with this tag requires Kakao Login. You must implement the Kakao Login function first, and then call the corresponding API by using the access token issued when a user logs in.

Web Login required

You can make a GET request using either an access token or your app's Admin key to use this API.

For a service administrator to check the Terms of Service that a user has consented to, request this API with the app's Admin key and a service user ID from a server. You must also add both target_id_type and target_id parameters into your request.

CAUTION

When you use your app's Admin key, you must call this API only from a server.

The response includes a service user ID, tags for terms, and the last time a user consented to the term. When a user attempts to log in after deleting the service account or unlinking from the app, the user goes through the Simple-signup process again. According to the time the user consents, the time information is updated.

Request

Using Access Token

URL
GET /v1/user/service/terms HTTP/1.1
Host: kapi.kakao.com
Authorization: Bearer ${ACCESS_TOKEN}
Header
Name Description Required
Authorization Access token as a type of user authentication.
Authorization: Bearer ${ACCESS_TOKEN}
O
Parameter
Name Type Description Required
extra String To request a list of Terms of Service used for an app, add this parameter in your request by specifying as extra=app_service_terms. X

Using Admin key

URL
GET /v1/user/service/terms HTTP/1.1
Host: kapi.kakao.com
Authorization: KakaoAK ${APP_ADMIN_KEY}
Header
Name Description Required
Authorization Admin key as a type of user authentication.
Authorization: KakaoAK ${APP_ADMIN_KEY}
O
Parameter
Name Type Description Required
target_id_type String A type of a service user ID.
Fixed as user_id
O
target_id Long Service user ID. O
extra String To request a list of Terms of Service used for an app, add this parameter in your request by specifying as extra=app_service_terms. X

Response

Key
Name Type Description Required
user_id Long Service user ID. O
app_service_terms AppServiceTerms[] A list of terms registered for an app. X
allowed_service_terms AllowedServiceTerms[] A list of terms that a user has consented to. X
AppServiceTerms
Name Type Description Required
tag String Tag that is specified in [My Application] > [Simple Signup] for each term. O
created_at Datetime The time when the term was registered.
(RFC3339 internet date/time format)
O
updated_at Datetime The time when the term was modified.
(RFC3339 internet date/time format)
O
AllowedServiceTerms
Name Type Description Required
tag String Tag of the term that a user consented to. O
agreed_at Datetime The last time when a user consented to the term.
(RFC3339 internet date/time format)
O

Sample

Request: Using Access Token
curl -v -X GET "https://kapi.kakao.com/v1/user/service/terms" \
-H "Authorization: Bearer ${ACCESS_TOKEN}"
Request: Using Admin Key
curl -v -X GET "https://kapi.kakao.com/v1/user/service/terms?target_id_type=user_id&target_id=111111" \
-H "Authorization: KakaoAK ${APP_ADMIN_KEY}"
Request: A list of terms set for an app, using Access Token
curl -v -X GET "https://kapi.kakao.com/v1/user/service/terms?extra=app_service_terms" \
-H "Authorization: Bearer ${ACCESS_TOKEN}"
Response: Success, the agreed terms return
{
 "user_id": 111111,
 "allowed_service_terms": [
  {
   "tag": "service_20190101",
   "agreed_at": "2019-05-10T10:33:26Z"
  },
  {
   "tag": "privacy_20190102",
   "agreed_at": "2019-05-10T10:33:26Z"
  }
 ]
}
Response: The agreed terms and a list of terms set for an app return
{
 "user_id": 111111,
 "allowed_service_terms": [
    {
    "tag": "age",
    "agreed_at": "2020-06-18T05:58:35Z"
    },
    {
    "tag": "additional_requirement_202002",
    "agreed_at": "2020-06-18T05:58:35Z"
    },
    {
    "tag": "service_20190326",
    "agreed_at": "2020-06-18T05:58:35Z"
    },
    {
    "tag": "privacy_20190326",
    "agreed_at": "2020-06-18T05:58:35Z"
    }
 ],
 "app_service_terms": [
    {
    "tag": "additional_requirement_202002",
    "created_at": "2020-02-14T06:10:36Z",
    "updated_at": "2020-02-14T07:59:07Z"
    },
    {
    "tag": "age",
    "created_at": "2020-03-24T01:12:46Z",
    "updated_at": "2020-03-24T01:12:46Z"
    },
    {
    "tag": "option1",
    "created_at": "2019-10-29T01:37:11Z",
    "updated_at": "2019-10-29T01:37:11Z"
    },
    {
    "tag": "privacy_20190326",
    "created_at": "2019-03-26T11:36:29Z",
    "updated_at": "2019-03-26T11:36:29Z"
    },
    {
    "tag": "required_111",
    "created_at": "2020-06-18T05:59:38Z",
    "updated_at": "2020-06-18T05:59:38Z"
    },
    {
    "tag": "service2_20190527",
    "created_at": "2019-05-27T02:49:06Z",
    "updated_at": "2019-10-16T05:24:58Z"
    },
    {
    "tag": "service_20190326",
    "created_at": "2019-03-26T11:36:29Z",
    "updated_at": "2019-03-26T11:36:29Z"
    }
 ]
}

Android Login required

Before you begin

To use this API on Android, add the v2-user module that provides UserApiClient in the module-level build.gradle file by referring to Add modules.

How to implement

Call the serviceTerms() method defined in the UserApiClient class.

Kotlin
RxKotlin
// Check the terms that a user has consented
UserApiClient.instance.serviceTerms { userServiceTerms, error ->
    if (error != null) {
        Log.e(TAG, "Failed to check the agreed terms", error)
    }
    else if (userServiceTerms != null) {
        Log.i(TAG, "Succeeded in checking the agreed terms" +
                "\nService user ID: ${userServiceTerms.userId}" +
                "\nAgreed terms: \n${userServiceTerms.allowedServiceTerms?.joinToString("\n")}")
    }
}
var disposables = CompositeDisposable()

// the terms that a user has consented
UserApiClient.rx.serviceTerms()
    .subscribeOn(Schedulers.io())
    .observeOn(AndroidSchedulers.mainThread())
    .subscribe({ userServiceTerms ->
        Log.i(TAG, "Succeeded in check the agreed terms" +
                "\nService user ID: ${userServiceTerms.userId}" +
                "\nAgreed terms: \n${userServiceTerms.allowedServiceTerms?.joinToString("\n")}")
    }, { error ->
        Log.e(TAG, "Failed to check the agreed terms", error)
    })
    .addTo(disposables)

If the request succeeds, the response returns through the UserServiceTerms object that contains a service user ID and allowedServiceTerms. allowedServiceTerms is the list of the ServiceTerms object that provides the consented time and tag information. For more details of serviceTerms, refer to API Reference and the response of Web.

Legacy Android Login required

Before you begin

To use this API on the Legacy Android,

  • A user must be in a logged-in state.
  • You must add the usermgmt module by referring to Install SDK.
How to implement

Call the UserManagement.serviceTerms() method to request the terms that a user has consented. To use this method, you must implement ApiResponseCallback that handles the response.

The response is the same as Web.

UserManagement.getInstance().serviceTerms(new
  ApiResponseCallback<ServiceTermsResponse>() {
    @Override
    public void onSessionClosed(ErrorResult errorResult) {
      // Login is required.
    }
    @Override
    public void onFailure(ErrorResult errorResult) {
      // Other errors
    }
    @Override
    public void onSuccess(ServiceTermsResponse result) {
      // Success callback
    }
});

iOS Login required

Before you begin

To use this API on iOS,

  • Add the KakaoSDKAuth(Kakao Login module) and KakaoSDKUser(User Management module that provides UserApi) in the Podfile by referring to Install SDK.
  • Add the import statements for the Kakao Login and the User Management modules.
Swift
RxSwift
import KakaoSDKAuth
import KakaoSDKUser
import KakaoSDKAuth
import RxKakaoSDKAuth

import KakaoSDKUser
import RxKakaoSDKUser

How to implement

Call the serviceTerms() method defined in the UserApi class.

If the request succeeds, the response returns through the UserServiceTerms object that contains a service user ID and allowedServiceTerms, the terms the user has consented to. allowedServiceTerms is the list of the ServiceTerms object that provides the consented time and the term's tag.

For more details of ServiceTerms, refer to API Reference and the response of Web.

Swift
RxSwift
UserApi.shared.serviceTerms {(serviceTerms, error) in
    if let error = error {
        print(error)
    }
    else {
        print("serviceTerms() success.")
        // Do something
        _ = serviceTerms
    }
}
// Class member property
let disposeBag = DisposeBag()

UserApi.shared.rx.serviceTerms()
    .subscribe(onSuccess:{ (serviceTerms) in
        print("serviceTerms() success.")
        
        // Do something
        _ = serviceTerms
        
    }, onFailure: {error in
        print(error)
    })
    .disposed(by: disposeBag)

Legacy iOS Login required

Before you begin

To use this API on the Legacy iOS,

  • You must implement Kakao Login beforehand.
  • A user has been logged in with a Kakao Account.
How to implement

Call the serviceTermsTask method to request the terms which a user has consented to.

The response is the same as the response of the Web. Refer to the Response of Web for more details of response.

KOSessionTask.serviceTermsTask(completionHandler: { (serviceTerms, error) in
    if let error = error as NSError? {
        print(error)
    }
    else {
        if let serviceTerms = serviceTerms {
            if let allowedTerms = serviceTerms.allowedTerms as [KOServiceTerms]? {
                for (index, terms) in allowedTerms.enumerated() {
                    print("[\(index)] tag:\(String(describing: terms.tag)) agreedAt:\(String(describing: terms.agreedAt))")
                }
            }
        }
    }
})

Flutter Login required

Before you begin

Before using the Flutter SDK, you must complete the prerequisites.

To check which terms a user has consented to when the user logs in, call the serviceTerms() method in the UserApi class.

Sample
try {
  UserServiceTerms userServiceTerms = await UserApi.instance.serviceTerms();
  print('Succeeded in checking the agreed terms.\nService user ID: ${userServiceTerms.userId}\nAgreed terms: \n${userServiceTerms.allowedServiceTerms?.join('\n')}');
} catch (e) {
    print('Failed to check the agreed terms.');
}
Return data

serviceTerms() returns the UserServiceTerms object.

UserServiceTerms
Name Type Description Required
userId Int Service user ID. X
appServiceTerms List<AppServiceTerms> A list of terms registered for an app. X
allowedServiceTerms List<ServiceTerms> A list of terms that a user has consented to. X
AppServiceTerms
Name Type Description Required
tag String Tag that is specified in [My Application] > [Simple Signup] for each term. O
createdAt Datetime The time when the term was registered.
(RFC3339 internet date/time format)
O
updatedAt Datetime The time when the term was modified.
(RFC3339 internet date/time format)
O
ServiceTerms
Name Type Description Required
tag String Tag of the term that a user consented to. O
agreedAt Datetime The last time when a user consented to the term.
(RFC3339 internet date/time format)
O

See more

Web

Android

iOS