Telegram Sign Up/Log In

Users can log in/register the system through their Telegram account

API Usage Instructions

Before calling the API, please ensure you have thoroughly read the relevant API documentation. Below are specific instructions for different login methods:

一、Setting Up Telegram Login Configuration

For more detailed steps, please refer to the Telegram developer documentation: Telegram Developer Documentation

Before using the third-party login service, you need to register as a developer on the respective platform and create an application. The registration steps for Telegram are as follows:

  1. Visit the Telegram API Documentation: Access the official Telegram API documentation to learn how to obtain your API ID and Hash.

  2. Create a New Application: Find the @BotFather bot on Telegram and use it to create a new bot (application).

  3. Get API ID and Hash: Through your conversation with @BotFather, obtain your application's API ID and API Hash.

  4. Configure API ID and API Hash in the White Label Management Backend.

二、Retrieve Third-Party Login Configuration Information

Call the third-party configuration API to obtain the Client ID registered in the first step.

Request Parameters:

{
    // Third-party source: Supported third-party login sources
    // Optional values include: google, facebook, twitter, telegram, apple, metamask, separated by commas
    "thirdSource": "google,telegram"  // Example: using Google and Telegram login
}

Response Structure:

三、Login Code Implementation

Refer to the documentation: Telegram Login Widget

1. Include the Telegram JavaScript SDK

Include the Telegram JavaScript SDK on your page as follows:

2. Initiate Login Authorization Request via Button:

3. Telegram Access Token Verification

Call the Telegram third-party login verification API.

Request Parameters:

Response Structure:

4. Complete Login/Register

Based on the information returned in the previous step, call the third-party login or registration API.

For Telegram login, please use the third-party social account login interface. Through these steps, you can successfully integrate Telegram login functionality and obtain the user's authorized Access Token. If you encounter issues during integration, please check the network connection or the configuration of your Telegram application to ensure all steps are correctly followed. For more information, please refer to the Telegram developer documentation.

Last updated