Telegram

A list of Telegram APIs

baseURL: wv2h4to5qa.execute-api.us-east-2.amazonaws.com/dev/telegram

To obtain x-api-key please contact the team. You can find more information at the "Connect With Us" section


Authentication

All requests require a valid API key to be included in the x-api-key header.

Send OTP the registered phone number in Telegram

POST https://<baseURL>/sendOTP

Sends an OTP to the provided phone number via Telegram

Query Parameters

Name
Type
Description

phone*

string (starts with +)

The phone number to which the OTP will be sent

{
    "isError": boolean,
    "data": {
        "phone_code_hash": string
    },
    "message": string
}

SignIn Telegram User

POST https://<baseURL>/signIn

Signs in a user to Telegram using the OTP sent to their phone

Query Parameters

Name
Type
Description

clientId*

string

The client's unique identifier

userId*

string

The user's unique identifier

phone*

string (starts with +)

The phone number used for sign-in

code*

string

The OTP received by the user

phone_code_hash*

string

The hash provided when the OTP was sent

{
  "isError": boolean,
  "message": string,
  "data": {
    "userId": string,
    "session": string
  }
}

Fetch Telegram User Data

GET https://<baseURL>/getUserData

Retrieves Telegram user data associated with a specific phone number

Query Parameters

Name
Type
Description

phone*

string (starts with +)

The phone number associated with the user

{
    "isError": boolean,
    "data": {
        "id": string,
        "username": string,
        "firstName": string,
        "lastName": string,
        "phoneNumber": string,
        "userAccessHash": string,
        "about": string,
        "photoType": string,
        "photoId": string,
        "photoAccessHash": string,
        "photoDcId": number,
        "userStatus": string,
        "isBot": boolean,
        "isVerified": boolean,
        "isRestricted": boolean,
        "isScam": boolean,
        "isPremium": boolean,
        "isFake": boolean,
        "createdAt": string,
        "updatedAt": string
    },
    "message": string
}

Fetch Telegram User Contact Data

GET https://<baseURL>/getUserContactData

Retrieves the contact data associated with a specific phone number

Query Parameters

Name
Type
Description

phone*

string (starts with +)

The phone number associated with the user’s contacts

{
    "isError": boolean,
    "data": {
        "savedContacts": [
            {
                "id": string,
                "username": string,
                "firstName": string,
                "lastName": string,
                "phoneNumber": "string,
                "userAccessHash": string,
                "about": string,
                "photoType": string,
                "photoId": string,
                "photoAccessHash": string,
                "photoDcId": string,
                "userStatus": string,
                "isBot": boolean,
                "isVerified": boolean,
                "isRestricted": boolean,
                "isScam": boolean,
                "isPremium": boolean,
                "isFake": boolean,
                "createdAt": string,
                "updatedAt": string
            }
        ]
    },
    "message": string
}

Fetch All Telegram Users

GET https://<baseURL>/getAllUsers

Fetches all Telegram users associated with the signed in user with pagination options (limit and offset)

Query Parameters

Name
Type
Description

limit

integer (optional)

The maximum number of users to return (default: 10)

offset

integer (optional)

The number of users to skip before starting to collect the result set (default: 20)

{
    "isError": boolean,
    "data": [
        {
            "id": string,
            "username": string,
            "firstName": string,
            "lastName": string,
            "phoneNumber": string,
            "userAccessHash": string,
            "about": string,
            "photoType": string,
            "photoId": string,
            "photoAccessHash": string,
            "photoDcId": number,
            "userStatus": string,
            "isBot": boolean,
            "isVerified": boolean,
            "isRestricted": boolean,
            "isScam": boolean,
            "isPremium": boolean,
            "isFake": boolean,
            "createdAt": string,
            "updatedAt": string
        }
    ],
    "message": string
}

Fetch All Telegram Groups

GET https://<baseURL>/getAllGroups

Fetches all Telegram groups associated with the signed in user with pagination options (limit and offset)

Query Parameters

Name
Type
Description

limit

integer (optional)

The maximum number of groups to return (default: 10)

offset

integer (optional)

The number of groups to skip before starting to collect the result set (default: 20)

{
    "isError": boolean,
    "data": [
        {
            "group_id": string,
            "group_name": string,
            "members_count": number,
        }
    ],
    "message": string
}

Fetch Groups Users Have Joined

GET https://<baseURL>/getAllGroupsUsersHaveJoined

Fetches all groups that a specific user has joined

Query Parameters

Name
Type
Description

phone*

string (starts with +)

The phone number associated with the user’s contacts

{
    "isError": boolean,
    "data": [
        {
            "group_id": string,
            "group_name": string,
            "members_count": number,
        }
    ],
    "message": string
}

Last updated