> For the complete documentation index, see [llms.txt](https://docs.rememberizer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rememberizer.ai/ar/mward-almtwryn/api-docs/retrieve-document-contents.md).

# استرجاع محتويات الوثائق

{% openapi src="/files/HnPQpOiuTrIsiKLD8NFc" path="/documents/{document\_id}/contents/" method="get" %}
[rememberizer\_openapi.yml](https://4065521171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKV4TZLzR1jCpM5coRezn%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=5e84eb03-c48b-4980-9792-73172ea64dd4)
{% endopenapi %}

## طلبات مثال

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X GET \
  "https://api.rememberizer.ai/api/v1/documents/12345/contents/?start_chunk=0&end_chunk=20" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
```

{% hint style="info" %}
استبدل `YOUR_JWT_TOKEN` برمز JWT الفعلي الخاص بك و `12345` بمعرف مستند فعلي.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const getDocumentContents = async (documentId, startChunk = 0, endChunk = 20) => {
  const url = new URL(`https://api.rememberizer.ai/api/v1/documents/${documentId}/contents/`);
  url.searchParams.append('start_chunk', startChunk);
  url.searchParams.append('end_chunk', endChunk);
  
  const response = await fetch(url.toString(), {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
  });
  
  const data = await response.json();
  console.log(data);
  
  // إذا كانت هناك المزيد من الأجزاء، يمكنك جلبها
  if (data.end_chunk < totalChunks) {
    // جلب مجموعة الأجزاء التالية
    await getDocumentContents(documentId, data.end_chunk, data.end_chunk + 20);
  }
};

getDocumentContents(12345);
```

{% hint style="info" %}
استبدل `YOUR_JWT_TOKEN` برمز JWT الفعلي الخاص بك و `12345` بمعرف مستند فعلي.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests

def get_document_contents(document_id, start_chunk=0, end_chunk=20):
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN"
    }
    
    params = {
        "start_chunk": start_chunk,
        "end_chunk": end_chunk
    }
    
    response = requests.get(
        f"https://api.rememberizer.ai/api/v1/documents/{document_id}/contents/",
        headers=headers,
        params=params
    )
    
    data = response.json()
    print(data)
    
    # إذا كانت هناك المزيد من الأجزاء، يمكنك جلبها
    # هذه مثال بسيط - قد ترغب في تنفيذ تحقق مناسب للتكرار
    if 'end_chunk' in data and data['end_chunk'] < total_chunks:
        get_document_contents(document_id, data['end_chunk'], data['end_chunk'] + 20)

get_document_contents(12345)
```

{% hint style="info" %}
استبدل `YOUR_JWT_TOKEN` برمز JWT الفعلي الخاص بك و `12345` بمعرف مستند فعلي.
{% endhint %}
{% endtab %}
{% endtabs %}

## معلمات المسار

| المعلمة      | النوع    | الوصف                                       |
| ------------ | -------- | ------------------------------------------- |
| document\_id | عدد صحيح | **مطلوب.** معرف الوثيقة لاسترجاع المحتويات. |

## معلمات الاستعلام

| المعلمة      | النوع    | الوصف                                                       |
| ------------ | -------- | ----------------------------------------------------------- |
| start\_chunk | عدد صحيح | فهرس الجزء الابتدائي. القيمة الافتراضية هي 0.               |
| end\_chunk   | عدد صحيح | فهرس الجزء النهائي. القيمة الافتراضية هي start\_chunk + 20. |

## تنسيق الاستجابة

```json
{
  "content": "النص الكامل لمحتوى أجزاء الوثيقة...",
  "end_chunk": 20
}
```

## استجابات الخطأ

| رمز الحالة | الوصف                 |
| ---------- | --------------------- |
| 404        | الوثيقة غير موجودة    |
| 500        | خطأ في الخادم الداخلي |

## تقسيم الصفحات للمستندات الكبيرة

بالنسبة للمستندات الكبيرة، يتم تقسيم المحتوى إلى أجزاء. يمكنك استرجاع المستند الكامل من خلال إجراء عدة طلبات:

1. قم بإجراء طلب أولي مع `start_chunk=0`
2. استخدم قيمة `end_chunk` المعادة كـ `start_chunk` للطلب التالي
3. استمر حتى تسترجع جميع الأجزاء

تقوم هذه النقطة النهائية بإرجاع المحتوى النصي الخام لمستند، مما يتيح لك الوصول إلى المعلومات الكاملة للمعالجة أو التحليل التفصيلي.


---

# 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://docs.rememberizer.ai/ar/mward-almtwryn/api-docs/retrieve-document-contents.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.
