> For the complete documentation index, see [llms.txt](https://tgtaps.gitbook.io/tgtaps-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tgtaps.gitbook.io/tgtaps-docs/integrations/api-methods.md).

# API methods

First of all,[ get API key](/tgtaps-docs/integrations/api-keys.md) to insert in all requests.

## Table of content

* [Get bot user](#get-bot-user)
* [Get bot user friends](#get-bot-user-friends)
* [Send message](#send-message)
* [Increase points](#increase-points)
* [Remove rate](#remove-rate)
* [Get rate](#get-rate)
* [Set rate](#set-rate)

### 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:

```json
{
  "tgId": 165299325,
  "createdAt": "2025-01-31T15:08:08.13319Z",
  "registeredByRefCode": null,
  "tgUsername": "rostislav_dugin",
  "tgName": "Rostislav Dugin",
  "points": 246889,
  "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:

```json
[
  {
    "tgId": 671934272,
    "createdAt": "2025-02-02T20:07:55.92733Z",
    "registeredByRefCode": "9acc329d-4cab-40f6-9801-746cc4773fda",
    "tgUsername": "username",
    "tgName": "User Name",
    "points": 0,
    "tonFriendlyAddress": "",
    "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
```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
}
```

### Set rate

**GET** <https://app.tgtaps.com/api/bot-users/externa;/set-rate?apiKey=**API\\_KEY**\\&botId=**BOT\\_ID**\\&userTgId=**TELEGRAM\\_ID**\\&rateId=**RATE\\_ID>\*\*

Example respose:

```
{
  "message": "Rate set successfully"
}
```

***

Something unclear in docs or you know how to improve article? [Message us in community!](https://docs.tgtaps.com/tgtaps-docs/readme/community)\
We will answer you and then promise to improve the article within 3 days.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://tgtaps.gitbook.io/tgtaps-docs/integrations/api-methods.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
