# 문서 가져오기

{% openapi src="<https://2913883985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fs0e4JCKQXzEGPRlMO7nt%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media&token=ac0eeb18-73cf-42a3-93fe-2ff232a978a3>" path="/documents/" method="get" %}
[rememberizer\_openapi.yml](https://2913883985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fs0e4JCKQXzEGPRlMO7nt%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=ac0eeb18-73cf-42a3-93fe-2ff232a978a3)
{% endopenapi %}

## 예제 요청

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

```bash
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"
```

{% hint style="info" %}
`YOUR_JWT_TOKEN`을(를) 실제 JWT 토큰으로 교체하세요.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
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();
```

{% hint style="info" %}
`YOUR_JWT_TOKEN`을(를) 실제 JWT 토큰으로 교체하세요.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
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")
```

{% hint style="info" %}
`YOUR_JWT_TOKEN`을(를) 실제 JWT 토큰으로 교체하세요.
{% endhint %}
{% endtab %}
{% endtabs %}

## 요청 매개변수

| 매개변수              | 유형  | 설명                                                                              |
| ----------------- | --- | ------------------------------------------------------------------------------- |
| page              | 정수  | 페이지 매김을 위한 페이지 번호. 기본값은 1입니다.                                                   |
| page\_size        | 정수  | 페이지당 항목 수. 기본값은 10입니다.                                                          |
| integration\_type | 문자열 | 통합 유형별로 문서를 필터링합니다. 옵션: google\_drive, slack, dropbox, gmail, common\_knowledge |

## 응답 형식

```json
{
  "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 | 공개 지식 출처         |

이 엔드포인트는 연결된 데이터 소스에서 문서 목록을 검색합니다. 특정 소스에 집중하기 위해 통합 유형으로 필터링할 수 있습니다.
