> For the complete documentation index, see [llms.txt](https://apidocs.webcom.mobi/ru2/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/ru2/type/specifikaciya-xml/zapros-statusa-sms/webhook.md).

# Webhook

Необходимо сообщить менеджеру адрес вашего сервера, который будет принимать статусы SMS

Метод отправки XML-документа: **`POST`**

К примеру, в **phpXML**-документ будет доступен через переменную **`$GLOBALS['HTTP_RAW_POST_DATA']`**

Система отправляет XML-документ серверу клиента следующего содержания:

```xml
<?xml version="1.0" encoding="utf-8" ?>
<response>
     <state id_sms="IDSMS в системе для проверки статуса" time="2011-01-01 12:57:46" sms="Статус">Статус</state>
     <state id_sms="IDSMS в системе для проверки статуса" time="2011-01-01 12:57:46" sms="Статус" viber="Статус">Статус</state>
     <state id_sms="IDSMS в системе для проверки статуса" time="2011-01-01 12:57:46" viber="Статус">Статус</state>
</response>
```

### Расшифровка параметров

<table><thead><tr><th width="149.33333333333331">Параметр</th><th width="149">Тип данных</th><th>Описание</th></tr></thead><tbody><tr><td>state</td><td>String</td><td><p>Последний статус сообщения:</p><ul><li>«send» - статус сообщения не получен. В этом случае передается пустой time (time="")</li><li>«not_deliver» - сообщение не было доставлено. Конечный статус (не меняется со временем)</li><li>«expired» - абонент находился не в сети в те моменты, когда делалась попытка доставки. Конечный статус (не меняется со временем)</li><li>«deliver» - сообщение доставлено.</li><li>«read» - сообщение прочитано. Конечный статус (не меняется со временем)</li><li>«partly_deliver» - сообщение было отправлено, но статус так и не был получен</li></ul></td></tr><tr><td>state.id_sms</td><td>Int</td><td>Номер SMS сообщения, полученный в ответном XML-документа в процессе отправки SMS сообщения</td></tr><tr><td>state.time</td><td>String</td><td>Время изменения статуса</td></tr><tr><td>state.sms, state.viber</td><td>String</td><td><p>Статус сообщения. </p><p><mark style="color:red;">Название поля зависит от типа отправляемого и досылаемого сообщения</mark></p></td></tr></tbody></table>

### Возвращаемый ответ сервера клиента в XML-документе

{% hint style="danger" %}
Если сервер клиента не передаст **id\_sms**, то статус будет считаться не полученным клиентом. При этому будет сделано 5 попыток доставить статус.
{% endhint %}

```xml
<?xml version="1.0" encoding="utf-8" ?>
<response>
     <id_sms>3234</id_sms>
     <id_sms>3235</id_sms>
</response>
```


---

# 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/ru2/type/specifikaciya-xml/zapros-statusa-sms/webhook.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.
