# Webhook

It is necessary to tell the manager the address of your server, which will receive SMS statuses

Method of sending XML document: **`POST`**

For example, in **phpXML**, the document will be accessible via a variabl&#x65;**`$GLOBALS['HTTP_RAW_POST_DATA']`**

The system sends an XML document to the client server with the following content:

```xml
<?xml version="1.0" encoding="utf-8" ?>
<response>.
     <state id_sms="IDSMS in system to check status" time="2011-01-01 12:57:46" sms="Status">Status</state>
     <state id_sms="IDSMS in system to check status" time="2011-01-01 12:57:46" sms="Status" viber="Status">Status</state>
     <state id_sms="IDSMS in system to check status" time="2011-01-01 12:57:46" viber="Status">Status</state>
</response>
```

### Parameter decoding

<table><thead><tr><th width="149.33333333333331">Parameter</th><th width="149">Data type</th><th>Description</th></tr></thead><tbody><tr><td>state</td><td>String</td><td><p>Last message status: </p><ul><li>"send" - message status not received. In this case, an empty time (time="") is transmitted </li><li>"not_deliver" - the message was not delivered. Final status (does not change with time) </li><li>"expired" - the subscriber was not in the network at the moments when the delivery attempt was made. Final status (does not change with time) </li><li>"deliver" - the message has been delivered. </li><li>"read" - the message has been read. Final status (does not change over time) </li><li>"partly_deliver" - the message was sent, but the status was not received.</li></ul></td></tr><tr><td>state.id_sms</td><td>Int</td><td>SMS message number received in the response XML document in the process of sending SMS message</td></tr><tr><td>state.time</td><td>String</td><td>Time of status change</td></tr><tr><td>state.sms, state.viber</td><td>String</td><td><p>Message status. </p><p><mark style="color:orange;">The name of the field depends on the type of the message to be sent and resent</mark></p></td></tr></tbody></table>

### Returned client server response in an XML document

{% hint style="danger" %}
If the client server does not transmit **id\_sms**, the status will be considered as not received by the client. In this case 5 attempts will be made to deliver the status.
{% endhint %}

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


---

# 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://apidocs.webcom.mobi/en/sposoby-vzaimodeistviya-s-a2p-platformoi/xml-specification/sms-status-request/webhook.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.
