# Lấy thông tin của một tài liệu

{% openapi src="<https://4187618229-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwbxu0T4faQnPtKbPzrD5%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media&token=b77a395b-ed7b-4546-9ec7-182d4939fd1b>" path="/vector-stores/{vector-store-id}/documents/{document-id}" method="get" %}
[rememberizer\_openapi.yml](https://4187618229-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwbxu0T4faQnPtKbPzrD5%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=b77a395b-ed7b-4546-9ec7-182d4939fd1b)
{% endopenapi %}

## Ví dụ Yêu Cầu

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

```bash
curl -X GET \
  https://api.rememberizer.ai/api/v1/vector-stores/vs_abc123/documents/1234 \
  -H "x-api-key: YOUR_API_KEY"
```

{% hint style="info" %}
Thay thế `YOUR_API_KEY` bằng khóa API Vector Store thực tế của bạn, `vs_abc123` bằng ID Vector Store của bạn, và `1234` bằng ID tài liệu.
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const getDocumentInfo = async (vectorStoreId, documentId) => {
  const response = await fetch(`https://api.rememberizer.ai/api/v1/vector-stores/${vectorStoreId}/documents/${documentId}`, {
    method: 'GET',
    headers: {
      'x-api-key': 'YOUR_API_KEY'
    }
  });
  
  const data = await response.json();
  console.log(data);
};

getDocumentInfo('vs_abc123', 1234);
```

{% hint style="info" %}
Thay thế `YOUR_API_KEY` bằng khóa API Vector Store thực tế của bạn, `vs_abc123` bằng ID Vector Store của bạn, và `1234` bằng ID tài liệu.
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests

def get_document_info(vector_store_id, document_id):
    headers = {
        "x-api-key": "YOUR_API_KEY"
    }
    
    response = requests.get(
        f"https://api.rememberizer.ai/api/v1/vector-stores/{vector_store_id}/documents/{document_id}",
        headers=headers
    )
    
    data = response.json()
    print(data)

get_document_info('vs_abc123', 1234)
```

{% hint style="info" %}
Thay thế `YOUR_API_KEY` bằng khóa API Vector Store thực tế của bạn, `vs_abc123` bằng ID Vector Store của bạn, và `1234` bằng ID tài liệu.
{% endhint %}
{% endtab %}
{% endtabs %}

## Tham số Đường dẫn

| Tham số         | Loại      | Mô tả                                          |
| --------------- | --------- | ---------------------------------------------- |
| vector-store-id | chuỗi     | **Bắt buộc.** ID của kho vector chứa tài liệu. |
| document-id     | số nguyên | **Bắt buộc.** ID của tài liệu cần lấy.         |

## Định dạng Phản hồi

```json
{
  "id": 1234,
  "name": "Hướng Dẫn Sản Phẩm.pdf",
  "type": "application/pdf",
  "vector_store": "vs_abc123",
  "size": 250000,
  "status": "đã lập chỉ mục",
  "processing_status": "đã hoàn thành",
  "indexed_on": "2023-06-15T10:30:00Z",
  "status_error_message": null,
  "created": "2023-06-15T10:15:00Z",
  "modified": "2023-06-15T10:30:00Z"
}
```

## Xác thực

Điểm cuối này yêu cầu xác thực bằng cách sử dụng khóa API trong tiêu đề `x-api-key`.

## Phản hồi Lỗi

| Mã Trạng Thái | Mô Tả                                                         |
| ------------- | ------------------------------------------------------------- |
| 401           | Không được phép - Khóa API không hợp lệ hoặc bị thiếu         |
| 404           | Không tìm thấy - Cửa hàng vector hoặc tài liệu không tìm thấy |
| 500           | Lỗi máy chủ nội bộ                                            |

Điểm cuối này lấy thông tin chi tiết về một tài liệu cụ thể trong cửa hàng vector. Nó hữu ích để kiểm tra trạng thái xử lý của các tài liệu riêng lẻ và lấy siêu dữ liệu như loại tệp, kích thước và dấu thời gian. Điều này có thể đặc biệt hữu ích khi khắc phục sự cố với việc xử lý tài liệu hoặc khi bạn cần xác minh rằng một tài liệu đã được lập chỉ mục đúng cách.
