> For the complete documentation index, see [llms.txt](https://apidocs.webcom.mobi/ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.webcom.mobi/ru/poluchenie-vkhodyashikh-soobshenii.md).

# Получение входящих сообщений

Спецификация для получения входящих сообщений: XML

{% tabs %}
{% tab title="XML" %}
Метод отправки **`POST`**

Кодировка XML-документов: **`UTF-8`**

Обязательный заголовок: **`Content-type: text/xml; charset=utf-8;`**

Адрес для запроса: **`https://my3.webcom.mobi/xml/incoming.php`**

### Параметры запроса на отправку сообщения <a href="#parametry-zaprosa-na-otpravku-soobsheniya-2" id="parametry-zaprosa-na-otpravku-soobsheniya-2"></a>

<table><thead><tr><th width="158">Параметр</th><th width="110.66666666666666">Тип</th><th>Описание</th></tr></thead><tbody><tr><td><p>request</p><p><mark style="color:blue;">.security</mark></p><p><mark style="color:blue;">.login</mark></p><p><mark style="color:orange;">[value]</mark>*</p></td><td>String</td><td>Ваш логин в системе</td></tr><tr><td><p>request</p><p><mark style="color:blue;">.security</mark></p><p><mark style="color:blue;">.password</mark></p><p><mark style="color:orange;">[value]</mark>*</p></td><td>String</td><td>Ваш пароль в системе</td></tr><tr><td><p>request</p><p><mark style="color:blue;">.security</mark></p><p><mark style="color:blue;">.token</mark></p><p><mark style="color:orange;">[value]</mark>*</p></td><td>String</td><td>Вместо логина и пароля можно использовать секретный ключ. Для его получения обратитесь к менеджеру</td></tr><tr><td><p>request</p><p><mark style="color:blue;">.time</mark></p><p><mark style="color:green;">[start]</mark>*</p></td><td>Date</td><td>Время (не включительно), с которого запрашиваются входящие сообщения</td></tr><tr><td><p>request</p><p><mark style="color:blue;">.time</mark></p><p><mark style="color:green;">[end]</mark></p></td><td>Date</td><td><p>Время (не включительно), по которое запрашиваются входящие сообщения. </p><p><mark style="color:orange;">Если не задан, то будут возвращены все смс</mark></p></td></tr></tbody></table>

\*- обязательный параметр

### В случае получения правильного XML-документа

```xml
<?xml version="1.0" encoding="utf-8" ?>
<response>
     <sms id_sms="1234" date_receive="2012-01-31 12:55:55" originator="79612242243" prefix="IGRA" phone="79611111111">Текст</sms>
     <sms id_sms="1234" date_receive="2012-01-31 12:55:55" originator="79612242243" prefix="IGRA" phone="79611111111">Текст</sms>
     …
</response>
```

<table><thead><tr><th width="190.66666666666666">Параметр</th><th width="124">Тип</th><th>Описание</th></tr></thead><tbody><tr><td><p>response</p><p><mark style="color:blue;">.sms</mark></p></td><td>String</td><td>Входящее сообщение</td></tr><tr><td><p>response</p><p><mark style="color:blue;">.sms</mark></p><p><mark style="color:green;">[id_sms]</mark></p></td><td>Int</td><td>Уникальный номер, состоящий только из цифр</td></tr><tr><td><p>response</p><p><mark style="color:blue;">.sms</mark></p><p><mark style="color:green;">[date_receive]</mark></p></td><td>Date</td><td>Дата и время получения сообщения</td></tr><tr><td><p>response</p><p><mark style="color:blue;">.sms</mark></p><p><mark style="color:green;">[originator]</mark></p></td><td>Int</td><td>Номер телефона абонента, отправившего</td></tr><tr><td><p>response</p><p><mark style="color:blue;">.sms</mark></p><p><mark style="color:green;">[prefix]</mark></p></td><td>String</td><td>Префикс. Начальная часть текста SMS, по которой было определено, что эта SMS принадлежит именно этому клиенту. (Используется если один и тот же номер используется разными клиентами.)</td></tr><tr><td><p>response</p><p><mark style="color:blue;">.sms</mark></p><p><mark style="color:green;">[phone]</mark></p></td><td>Int</td><td>Номер телефона, на который была отправлено сообщение</td></tr></tbody></table>

### &#x20;В случае возникновения ошибки в отправленном XML-документе

```xml
<?xml version="1.0" encoding="utf-8"?>
<response>
     <error>текст ошибки</error>
</response>
```

<table><thead><tr><th width="197.66666666666666">Параметр</th><th width="121">Тип</th><th>Описание</th></tr></thead><tbody><tr><td><p>response</p><p><mark style="color:blue;">.error</mark></p></td><td>String</td><td><p>Текст ошибки может принимать следующие значения:</p><ul><li>Неправильный формат XML документа </li><li>Ваш аккаунт заблокирован</li><li>Неправильный логин или пароль</li><li>POST данные отсутствуют</li></ul></td></tr></tbody></table>

### &#x20;Пример XML запроса

```xml
<?xml version="1.0" encoding="utf-8" ?>
<request>
    <security>
        <login value="логин" />
        <password value="пароль" />
    </security>
    <time start="2012-01-31 12:23:00" end="2012-02-31 12:23:00" />
</request>
```

{% endtab %}
{% endtabs %}


---

# 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://apidocs.webcom.mobi/ru/poluchenie-vkhodyashikh-soobshenii.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.
