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

# API настройка

## Сообщения

### Google Colab <a href="#google-colab" id="google-colab"></a>

```
https://colab.research.google.com/drive/1eJlKKpRMRv6PIgA8rzMO6_ZpdmnnhU_P?usp=sharing
```

### Отправить сообщение <a href="#send-message" id="send-message"></a>

```
import requests import json

url = "https://api.iiagent.pro/api/v1.0/send_message"

payload = { "chat_id": "c3", "message_id": "m1", "message": "2+2" }

API_KEY = '3397_3QEg2tuvp9pXXXXXXXXXXXXXXX'

headers = { "Content-Type": "application/json", "Authorization": f"Bearer {API_KEY}", }

response = requests.request("POST", url, headers=headers, data=json.dumps(payload))

print(response.text)
```

### Получать Все сообщения

```
import requests

url = "https://api.iiagent.pro/api/v1.0/get_messages"

payload = { "chat_id": "c3" }

API_KEY = '3397_3QEg2tuvp9pXXXXXXXXXXXXXXXXXX'

headers = { "Content-Type": "application/json", "Authorization": f"Bearer {API_KEY}", }

response = requests.request("POST", url, headers=headers, data=json.dumps(payload))

response.json()
```

### Публикация Отправить сообщение

```
https://api.iiagent.pro/api/v1.0/send_message
```

Пример запроса

```
curl --location 'https://api.iiagent.pro/api/v1.0/send_message' \
--data '{
    "chat_id": "c3",
    "message_id": "m1",
    "message": "2+2"
}'
```

### АВТОРИЗАЦИЯ Токен на предъявителя

```
Жетон  <токен>
```

```
Тело   необработанный (json)

```

json

```json
{
    "chat_id": "c3",
    "message_id": "m1",
    "message": "2+2"
}
```

### Публикация Получаем сообщения

```
https://api.iiagent.pro/api/v1.0/get_messages
```

Пример запроса

```
curl --location 'https://api.iiagent.pro/api/v1.0/get_messages' \
--data '{
    "chat_id": "c3"
}'
```

### АВТОРИЗАЦИЯ Токен на предъявителя

```
Жетон   <токен>
```

```
Тело   необработанный (json)
```

json

```json
{
    "chat_id": "c3"
}
```


---

# 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://docs.iiagent.pro/api/api-nastroika.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.
