انتقل إلى المحتوى

استرجاع المستندات

GET /documents/

Use this operation to retrieve metadata about all available documents and Slack channels within the data sources.

Parameter In Type Required Description
page query integer Page's index
page_size query integer The maximum number of documents returned in a page

Responses

  • 200 — Successful operation

طلبات مثال

curl -X GET   
  "https://api.rememberizer.ai/api/v1/documents/?page=1&page_size=20&integration_type=google_drive"   
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Info

استبدل YOUR_JWT_TOKEN برمز JWT الفعلي الخاص بك.

const getDocuments = async (page = 1, pageSize = 20, integrationType = 'google_drive') => {
  const url = new URL('https://api.rememberizer.ai/api/v1/documents/');
  url.searchParams.append('page', page);
  url.searchParams.append('page_size', pageSize);
  if (integrationType) {
    url.searchParams.append('integration_type', integrationType);
  }

  const response = await fetch(url.toString(), {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
  });

  const data = await response.json();
  console.log(data);
};

getDocuments();

Info

استبدل YOUR_JWT_TOKEN برمز JWT الفعلي الخاص بك.

import requests

def get_documents(page=1, page_size=20, integration_type=None):
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN"
    }

    params = {
        "page": page,
        "page_size": page_size
    }

    if integration_type:
        params["integration_type"] = integration_type

    response = requests.get(
        "https://api.rememberizer.ai/api/v1/documents/",
        headers=headers,
        params=params
    )

    data = response.json()
    print(data)

get_documents(integration_type="google_drive")

Info

استبدل YOUR_JWT_TOKEN برمز JWT الفعلي الخاص بك.

معلمات الطلب

المعلمة النوع الوصف
page عدد صحيح رقم الصفحة للتقسيم. القيمة الافتراضية هي 1.
page_size عدد صحيح عدد العناصر في كل صفحة. القيمة الافتراضية هي 10.
integration_type سلسلة تصفية الوثائق حسب نوع التكامل. الخيارات: google_drive, slack, dropbox, gmail, common_knowledge

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

{
  "count": 257,
  "next": "https://api.rememberizer.ai/api/v1/documents/?page=2&page_size=20&integration_type=google_drive",
  "previous": null,
  "results": [
    {
      "document_id": "1aBcD2efGhIjK3lMnOpQrStUvWxYz",
      "name": "اقتراح المشروع.docx",
      "type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
      "path": "/Documents/Projects/Proposal.docx",
      "url": "https://drive.google.com/file/d/1aBcD2efGhIjK3lMnOpQrStUvWxYz/view",
      "id": 12345,
      "integration_type": "google_drive",
      "source": "user@example.com",
      "status": "مفهرس",
      "indexed_on": "2023-06-15T10:30:00Z",
      "size": 250000
    },
    // ... المزيد من الوثائق
  ]
}

أنواع التكامل المتاحة

نوع التكامل الوصف
google_drive مستندات من Google Drive
slack رسائل وملفات من Slack
dropbox ملفات من Dropbox
gmail رسائل بريد إلكتروني من Gmail
common_knowledge مصادر المعرفة العامة

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