Skip to main content
Latest SDK versions: Web 2.1.0 · Android 2.1.0View release notes
This guide walks you through displaying a clickwrap agreement in your Android app and verifying consent on your backend. For a detailed overview of how the pieces fit together, see the Integration flow.

Prerequisites

  1. A ClickTerm account
  2. A published template with an effective version (see Product Guide)
  3. An integration with your App ID and App Key (from Integrations)
Need to set up your credentials and template first? See Creating an app & template.

1. Add the SDK dependency

Add the SDK to your app-level build.gradle:
app/build.gradle
dependencies {
    implementation 'com.clickterm:android-sdk:2.1.0'
}
Sync your project after adding the dependency. For more details, see Android SDK Installation.

2. Initialize the SDK

In your Application class or MainActivity, initialize the SDK with your App ID. You can obtain it from the Integrations menu in the ClickTerm dashboard.
import com.clickterm.sdk.ClicktermClient;

ClicktermClient.initialize("YOUR_CLICKTERM_APP_ID");
Never expose your App Key in client-side code. The App Key is used only for backend verification calls. The client SDK uses only the App ID. Store the App Key safely — it won’t display again after creation, but can be regenerated. Regenerating the key requires updating your backend configuration.
Without initialization the SDK will not work and you will get an error when trying to request a clickwrap.

3. Show the clickwrap dialog

Call ClicktermDialog.show() to present the agreement. The SDK fetches the current effective template version from ClickTerm and displays it in a modal dialog. Once the end user accepts or declines, the SDK creates an event in ClickTerm and returns a Signature to your application via the callback. The event remains unverified until your backend calls the verification endpoint.
example.java
ClickwrapTemplate request = new ClickwrapTemplate(
    "YOUR_TEMPLATE_ID",  // From the ClickTerm dashboard
    endUserId,           // Your identifier for the end user
    new HashMap<>(),     // Optional placeholders
    "en"                 // Optional language — falls back to default
);

ClicktermDialog.show(this, request, null,
    new ClicktermDialog.OnAgreementResultListener() {
        @Override
        public void onSuccess(String clicktermSignature) {
            if (clicktermSignature == null) {
                // User already accepted the latest major version — no dialog was shown
                return;
            }
            // Send Signature to your backend for verification
            sendToBackend(clicktermSignature);
        }

        @Override
        public void onError(String message) {
            Log.e("Clickterm", message);
        }
    }
);
The dialog only appears if the user hasn’t already accepted the latest major version. Requests to show a clickwrap are not counted toward billing. For the full list of parameters, result fields, and configuration options, see Displaying a clickwrap.

4. Verify on your backend

Send the Signature to your server, then call ClickTerm’s verification endpoint with your App ID and App Key. This verifies the event — confirming the Signature hasn’t been forged or tampered with. For accepted events, a Certificate of Acceptance is generated.
curl -X POST https://api.clickterm.com/public-client/v1/clickwrap/verify \
  -H "X-APP-ID: YOUR_APP_ID" \
  -H "X-APP-KEY: YOUR_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"clicktermSignature": "SIGNATURE_FROM_SDK"}'
The response contains clickwrapEventStatus ("ACCEPTED" or "DECLINED") along with the full event metadata (event ID, template version, timestamps, etc.).
  • ACCEPTED — The user accepted the terms. The event is now verified and a Certificate of Acceptance is generated.
  • DECLINED — The event is still verified, but no Certificate of Acceptance is generated. It is up to your application to decide how to handle this (e.g., blocking the user journey, restricting features, or allowing continued access).
Requests to /clickwrap/verify are counted toward billing. Implement rate limiting or a Captcha check before this step to prevent abuse.
For full request/response details and framework-specific examples (Node.js, Python, Java), see Verifying a Signature.

Next steps

Android SDK reference

Full API reference for the Android SDK.

Template placeholders

Pass user-specific data into your templates.

Integration flow

Understand the complete architecture.