> For the complete documentation index, see [llms.txt](https://help.watbot.ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.watbot.ru/chat-boty/bloki/specialnye/blok-http-zapros.md).

# HTTP-запрос

### Шаг №1 - Создание блока HTTP-запрос

![Меню создания блока HTTP-запрос](/files/-LqfBbHXCDpfSijXkz8q)

### Шаг №2 - Настройка

![Настройка HTTP-запроса](/files/-LqfC2YsidEWmqzVnC-S)

Укажите тип запроса и ваш URL для обработки запроса. На данный момент поддерживаются методы `GET` и `POST`.

## Запрос

В теле запроса приходят все пользовательские переменные полученные на предыдущих шагах, контакт пользователя и данные crm систем.

#### Пример запроса:

```javascript
{
    "variables": [
        {
            "name": "Город",
            "value": "Москва"
        }
    ],
    "contact": {
        "name": "Дмитрий",
        "messenger": "whatsapp",
        "phone": "79999999999"
    }
}
```

{% hint style="warning" %}
**Время ожидания соединения:** 3 секунды
{% endhint %}

#### Ответ

В случае успеха, сервер должен ответить кодом `200`, а тело должно содержать текст для пользователя.

Текст должен быть форматирован под стандарты WhatsApp. Форматирование под другие мессенджеры происходит автоматически на нашем сервере.

В случае ошибки (например валидации), вы можете сообщить пользователю об этом. Для этого сервер должен ответить кодом `422`, а тело должно содержать сообщение для пользователя.

В таком случае не забудьте указать переменную в конструкторе для данного шага, в которую запишется ответ пользователя и отправиться на ваш сервер еще раз.

![Переменная в блоке HTTP-запроса](/files/-LqfDNRbnnX0E07-PKJK)

{% hint style="warning" %}
**Время получения ответа:** 5 секунд
{% endhint %}

В ссылку для блоков HTTP-запрос и Webhook возможно подставлять пользовательские переменные и константы

![](/files/bG7AMAhCMNIVTMbI13ak)

Вы можете настроить отправку данных контакта:

<figure><img src="/files/rzqz1FFO3uynSVUoEJln" alt=""><figcaption></figcaption></figure>

Поле автоматически растягивается по высоте, это делает более удобным редактирование длинных ссылок

<figure><img src="/files/yN4spJqkB5j2rccYSfV8" alt=""><figcaption></figcaption></figure>


---

# 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://help.watbot.ru/chat-boty/bloki/specialnye/blok-http-zapros.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.
