4.1 API Reference - Click Verification

Click Verification

The Apps Network system supports task click verification and ensures accurate tracking and rewarding of user engagement.

API Endpoint

For your TMA, use the following API endpoint:

GET https://click.dmtp.tech/banners/verify?tui=

Parameters

  • tui: Telegram User ID (only for TMA environments)

Usage

Retrieve the Telegram User ID from the TMA environment and use it in the API call:

GET https://click.dmtp.tech/banners/verify?tui=123456789

JavaScript Example (TMA)

// Assuming you're using the Telegram WebApp API
const tui = window.Telegram.WebApp.initDataUnsafe.user.id;

if (tui) {
    fetch(`https://click.dmtp.tech/banners/verify?tui=${encodeURIComponent(tui)}`)
        .then(response => response.json())
        .then(data => {
            if (data.valid) {
                console.log('Valid click! Reward the user.');
                // Add your reward logic here
            }
        })
        .catch(error => console.error('Error:', error));
}

Implementation Notes

  1. In TMA mode, prioritize using the Telegram User ID for verification.

  2. The click verification data is cached for 5 minutes. Perform the verification promptly after the user enters your game.

  3. If the verification is successful, award the user with the predetermined in-game bonus.

By correctly implementing this click verification system, you ensure that users are properly rewarded for engaging with tasks, maintaining the integrity of the advertising ecosystem.

Last updated