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

# تشغيل نقطة نهاية باستخدام التوثيق

### استغلال نقطة نهاية API باستخدام التوثيق

**هدف المختبر**

الهدف من هذا المختبر هو تحديد موقع توثيق API المكشوف ثم استخدام نقطة نهاية لإزالة المستخدم **carlos**. / يتم توفير حساب صالح للاختبار:

* **بيانات الاعتماد**: `wiener:peter`

**اكتشاف توثيق API**

يكشف استكشاف التطبيق عن مسار يؤدي إلى **واجهة برمجة تطبيقات REST** يحتوي على توثيقه. / يصف هذا التوثيق بوضوح نقاط النهاية المتاحة ويقدم حتى أمثلة على طلبات جاهزة للاستخدام، بما في ذلك على شكل **curl** أوامر.

<figure><img src="/files/809898be6e064beef2d359a5c1217f92d44435f9" 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/6f02483f8a0547b534f7bbf9ed7fa92ce780e9ea" 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/815cd96bed222ebc433f117975a896d29e1970bb" 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/ar/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.
