Memento

Mementos cho phép người dùng định nghĩa các bộ sưu tập tài liệu có thể được truy cập bởi các ứng dụng. Tài liệu này phác thảo các API Memento có sẵn.

Danh sách Memento

Ví dụ Yêu cầu

curl -X GET \
  https://api.rememberizer.ai/api/v1/mementos/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Để thử nghiệm cuộc gọi API này, hãy thay thế YOUR_JWT_TOKEN bằng mã thông báo JWT thực tế của bạn.

Tạo Memento

Ví dụ Yêu Cầu

curl -X POST \
  https://api.rememberizer.ai/api/v1/mementos/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Tài liệu Công việc"}'

Để thử nghiệm cuộc gọi API này, hãy thay thế YOUR_JWT_TOKEN bằng mã thông báo JWT thực tế của bạn.

Lấy Chi Tiết Memento

Ví dụ Yêu cầu

curl -X GET \
  https://api.rememberizer.ai/api/v1/mementos/123/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Để thử nghiệm cuộc gọi API này, hãy thay thế YOUR_JWT_TOKEN bằng mã thông báo JWT thực tế của bạn và 123 bằng ID memento thực tế.

Quản lý Tài liệu Memento

Ví dụ Yêu cầu

curl -X POST \
  https://api.rememberizer.ai/api/v1/mementos/memento_document/123/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "memento": "123",
    "add": ["document_id_1", "document_id_2"],
    "folder_add": ["folder_id_1"],
    "remove": ["document_id_3"]
  }'

Để thử nghiệm cuộc gọi API này, hãy thay thế YOUR_JWT_TOKEN bằng mã thông báo JWT thực tế của bạn và sử dụng các ID tài liệu và thư mục thực tế.

Xóa Memento

Ví dụ Yêu cầu

curl -X DELETE \
  https://api.rememberizer.ai/api/v1/mementos/123/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Để thử nghiệm cuộc gọi API này, hãy thay thế YOUR_JWT_TOKEN bằng mã thông báo JWT thực tế của bạn và 123 bằng ID memento thực tế.

const deleteMemento = async (mementoId) => {
  const response = await fetch(`https://api.rememberizer.ai/api/v1/mementos/${mementoId}/`, {
    method: 'DELETE',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
  });
  
  if (response.status === 204) {
    console.log("Memento đã được xóa thành công");
  } else {
    console.error("Xóa memento không thành công");
  }
};

deleteMemento(123);

Để thử nghiệm cuộc gọi API này, hãy thay thế YOUR_JWT_TOKEN bằng mã thông báo JWT thực tế của bạn và 123 bằng ID memento thực tế.

import requests

def delete_memento(memento_id):
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN"
    }
    
    response = requests.delete(
        f"https://api.rememberizer.ai/api/v1/mementos/{memento_id}/",
        headers=headers
    )
    
    if response.status_code == 204:
        print("Memento đã được xóa thành công")
    else:
        print("Xóa memento không thành công")

delete_memento(123)

Để thử nghiệm cuộc gọi API này, hãy thay thế YOUR_JWT_TOKEN bằng mã thông báo JWT thực tế của bạn và 123 bằng ID memento thực tế.

{% endtabs %

Last updated