> 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/de/web/api-testing/operating-an-endpoint-using-documentation.md).

# Betrieb eines Endpunkts mithilfe der Dokumentation

### Ausnutzung eines API-Endpunkts mithilfe der Dokumentation

**Lernziel**

Ziel dieses Labs ist es, freigelegte API-Dokumentation zu finden und dann einen Endpunkt zu verwenden, um den Benutzer zu löschen **carlos**. / Ein gültiges Konto wird zum Testen bereitgestellt:

* **Anmeldedaten**: `wiener:peter`

**Auffinden der API-Dokumentation**

Durch das Erkunden der Anwendung wird eine Route identifiziert, die zu einem **REST-API** führt, die ihre Dokumentation enthält. / Diese Dokumentation beschreibt die verfügbaren Endpunkte klar und bietet sogar Beispiele für einsatzbereite Anfragen, einschließlich in Form von **curl** Befehlen.

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

**Abruf von Benutzerinformationen**

Aus der Dokumentation geht hervor, dass ein Endpunkt es ermöglicht, Informationen über einen Benutzer durch Angabe seines Namens abzurufen. / Die bereitgestellte Anfrage liefert Benutzerdaten **carlos**:

* Anfrage:
* Methode: `GET`
* Endpunkt: `/api/user/carlos`

{% code overflow="wrap" %}

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

{% endcode %}

* Antwort:
* Der Server gibt ein JSON-Objekt zurück, das den Benutzernamen und die E-Mail-Adresse enthält.

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

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

**Löschen des Benutzers carlos**

Die Dokumentation weist außerdem darauf hin, dass es möglich ist, einen Benutzer über eine eigene Anfrage zu löschen. / Mit dem entsprechenden Endpunkt und der passenden Methode:

* Anfrage:
* Methode: `DELETE`
* Endpunkt: `/api/user/carlos`

{% code overflow="wrap" %}

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

{% endcode %}

* Ergebnis:
* Der Server akzeptiert die Anfrage und gibt eine Meldung zurück, die die Entfernung des Benutzers bestätigt.

```json
{
  "status": "Benutzer gelöscht"
}
```

<figure><img src="/files/fa448b98ae11bf3a0cd40c37b73103e239f07445" 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/de/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.
