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

```
GET https://docs.iiagent.pro/api/api-nastroika.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
