# Исходящие события и сообщения (от бота и оператора)

## Сообщение от оператора

```json
{
  "chat": {
    "client_id": "e937a119-baf5-4aa4-aa21-42795043e236",
    "uuid": "eece0483-18d3-4afe-97d5-f4dcea3f9d11"
  },
  "id": "8545eba1-db6e-421b-bcf1-19b3275d4f2f",
  "payload": {
    "text": "Текст сообщения",
    "type": "text"
    },
  "sender": {
    "avatar": null,
    "name": "Александр",
    "type": "operator"
  },
  "timestamp": 1744213501302
}
```

## Сообщение от бота (без кнопок)

```json
{
  "chat": {
    "client_id": "e937a119-baf5-4aa4-aa21-42795043e236",
    "uuid": "eece0483-18d3-4afe-97d5-f4dcea3f9d11"
  },
  "id": "8545eba1-db6e-421b-bcf1-19b3275d4f2f",
  "payload": {
    "text": "Текст сообщения",
    "type": "text"
  },
  "sender": {
    "avatar": null,
    "name": null,
    "type": "operator"
  },
  "timestamp": 1744213501302
}
```

## Сообщение от бота (с кнопками)

```json
{
  "chat": {
    "client_id": "e937a119-baf5-4aa4-aa21-42795043e236",
    "uuid": "eece0483-18d3-4afe-97d5-f4dcea3f9d11"
  },
  "id": "6a4b1bb2-856e-42e4-9d4c-a2000034c5bb",
  "payload": {
    "qr_buttons": [
      {
        "payload": "{\"data\": \"/switch/Тест 1/\", \"generated_by_node_pk\": 1, \"button_text\": \"Кнопка-узел\"}",
        "title": "Кнопка-узел",
        "type": "postback"
      },
      {
        "title": "Кнопка-ссылка",
        "type": "web_url",
        "url": "https://ya.ru/"
      },
      {
        "payload": "{\"data\": \"/text/Это текст\", \"generated_by_node_pk\": 1, \"button_text\": \"Кнопка-текстовый ответ\"}",
        "title": "Кнопка-текст",
        "type": "postback"
      }
    ],
    "text": "Текст сообщения",
    "type": "text"
  },
  "sender": {
    "avatar": null,
    "name": "TestBot",
    "type": "bot"
  },
  "timestamp": 1744213682863
}
```


---

# 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.fstrk.io/knowledge_base/channels/svoi-kanal-api/iskhodyashie-sobytiya-i-soobsheniya-ot-bota-i-operatora.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.
