API methods

First of all, get API key to insert in all requests.

Table of content

Get bot user

Get information about user.

GET https://app.tgtaps.com/api/bot-users/external/bot-user?apiKey=API_KEY&botId=BOT_ID&userTelegramId=TELEGRAM_ID

Example response:

{
  "tgId": 165299325,
  "createdAt": "2025-01-31T15:08:08.13319Z",
  "registeredByRefCode": null,
  "tgUsername": "rostislav_dugin",
  "tgName": "Rostislav Dugin",
  "points": 246889,
  "maxEnergy": 1000,
  "customValue": 0,
  "autominePointsPerHour": 0,
  "tonFriendlyAddress": "",
  "level": 2,
  "lastIp": null
}

Get bot user friends

Get friends of the user.

GET https://app.tgtaps.com/api/bot-users/external/bot-user-friends?botId=BOT_ID&apiKey=API_KEY&userTelegramId=TELEGRAM_ID

Example response:

[
  {
    "tgId": 671934272,
    "createdAt": "2025-02-02T20:07:55.92733Z",
    "registeredByRefCode": "9acc329d-4cab-40f6-9801-746cc4773fda",
    "tgUsername": "username",
    "tgName": "User Name",
    "points": 0,
    "maxEnergy": 1000,
    "customValue": 0,
    "autominePointsPerHour": 0,
    "tonFriendlyAddress": "",
    "level": 0,
    "lastIp": null
  }
]

Send message

Send message via bot to the user.

POST https://app.tgtaps.com/api/bot-users/external/send-message

Example request body:

```json
{
  "botId": "BOT_ID",
  "apiKey": "API_KEY",
  "userTelegramId": "TELEGRAM_ID",
  "message": "<b>Hello</b> world",
  "isEnableHtml": true
}
```

You can use HTML tags to format your message.

Increase points

Increase points of the user.

GET https://app.tgtaps.com/api/bot-users/external/increase-points?botId=BOT_ID&apiKey=API_KEY&userTelegramId=TELEGRAM_ID&points=AMOUNT

Remove rate

To remove rate by Telegram ID, use:

GET https://app.tgtaps.com/api/bot-users/external/remove-rate?apiKey=API_KEY&botId=BOT_ID&userTgId=TELEGRAM_ID

P.S. Requests are logged by TgTaps. It will not protect you from killing your subscriptions in case of your mistake in the code. At least, we will know when it happened.

Get rate

GET https://app.tgtaps.com/api/bot-users/external/get-rate?apiKey=API_KEY&botId=BOT_ID&userTgId=TELEGRAM_ID

Example responses (with and without rates):

{
  "rateId": "01fa38b1-619c-4815-a983-9598073ef8fb",
  "rateName": "Премиум"
}
{
  "rateId": null,
  "rateName": null
}

Something unclear in docs or you know how to improve article? Message us in community! We will answer you and then promise to improve the article within 3 days.

Last updated