> 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/zh-cn/kai-fa-zhe-zi-yuan/api-docs/mementos.md).

# 备忘录 API

Mementos 允许用户定义可以被应用程序访问的文档集合。本文档概述了可用的 Memento API。

## 列出纪念品

{% openapi src="/files/MHZeBzqvJFrULa5h2LlV" path="/mementos/" method="get" %}
[rememberizer\_openapi.yml](https://1371168417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gvX7KIUy0DhcQETj8Ux%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=cce1ab0d-330f-4bed-b7da-5635aaf25472)
{% endopenapi %}

### 示例请求

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

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

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌。
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const fetchMementos = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/mementos/', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
  });
  
  const data = await response.json();
  console.log(data);
};

fetchMementos();
```

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌。
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests

def fetch_mementos():
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN"
    }
    
    response = requests.get(
        "https://api.rememberizer.ai/api/v1/mementos/",
        headers=headers
    )
    
    data = response.json()
    print(data)

fetch_mementos()
```

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌。
{% endhint %}
{% endtab %}
{% endtabs %}

## 创建备忘录

{% openapi src="/files/MHZeBzqvJFrULa5h2LlV" path="/mementos/" method="post" %}
[rememberizer\_openapi.yml](https://1371168417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gvX7KIUy0DhcQETj8Ux%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=cce1ab0d-330f-4bed-b7da-5635aaf25472)
{% endopenapi %}

### 示例请求

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

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/mementos/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "工作文档"}'
```

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌。
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const createMemento = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/mementos/', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: '工作文档'
    })
  });
  
  const data = await response.json();
  console.log(data);
};

createMemento();
```

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌。
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def create_memento():
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN",
        "Content-Type": "application/json"
    }
    
    payload = {
        "name": "工作文档"
    }
    
    response = requests.post(
        "https://api.rememberizer.ai/api/v1/mementos/",
        headers=headers,
        data=json.dumps(payload)
    )
    
    data = response.json()
    print(data)

create_memento()
```

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌。
{% endhint %}
{% endtab %}
{% endtabs %}

## 获取备忘录详情

{% openapi src="/files/MHZeBzqvJFrULa5h2LlV" path="/mementos/{id}/" method="get" %}
[rememberizer\_openapi.yml](https://1371168417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gvX7KIUy0DhcQETj8Ux%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=cce1ab0d-330f-4bed-b7da-5635aaf25472)
{% endopenapi %}

### 示例请求

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

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

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌，并将 `123` 替换为实际的纪念 ID。
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const getMementoDetails = async (mementoId) => {
  const response = await fetch(`https://api.rememberizer.ai/api/v1/mementos/${mementoId}/`, {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
  });
  
  const data = await response.json();
  console.log(data);
};

getMementoDetails(123);
```

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌，并将 `123` 替换为实际的纪念 ID。
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests

def get_memento_details(memento_id):
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN"
    }
    
    response = requests.get(
        f"https://api.rememberizer.ai/api/v1/mementos/{memento_id}/",
        headers=headers
    )
    
    data = response.json()
    print(data)

get_memento_details(123)
```

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌，并将 `123` 替换为实际的纪念 ID。
{% endhint %}
{% endtab %}
{% endtabs %}

## 管理纪念品文档

{% openapi src="/files/MHZeBzqvJFrULa5h2LlV" path="/mementos/memento\_document/{memento\_id}/" method="post" %}
[rememberizer\_openapi.yml](https://1371168417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gvX7KIUy0DhcQETj8Ux%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=cce1ab0d-330f-4bed-b7da-5635aaf25472)
{% endopenapi %}

### 示例请求

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

```bash
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"]
  }'
```

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌，并使用实际的文档和文件夹 ID。
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const manageMementoDocuments = async (mementoId) => {
  const response = await fetch(`https://api.rememberizer.ai/api/v1/mementos/memento_document/${mementoId}/`, {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      memento: mementoId,
      add: ["document_id_1", "document_id_2"],
      folder_add: ["folder_id_1"],
      remove: ["document_id_3"]
    })
  });
  
  const data = await response.json();
  console.log(data);
};

manageMementoDocuments(123);
```

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌，并使用实际的文档和文件夹 ID。
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def manage_memento_documents(memento_id):
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN",
        "Content-Type": "application/json"
    }
    
    payload = {
        "memento": memento_id,
        "add": ["document_id_1", "document_id_2"],
        "folder_add": ["folder_id_1"],
        "remove": ["document_id_3"]
    }
    
    response = requests.post(
        f"https://api.rememberizer.ai/api/v1/mementos/memento_document/{memento_id}/",
        headers=headers,
        data=json.dumps(payload)
    )
    
    data = response.json()
    print(data)

manage_memento_documents(123)
```

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌，并使用实际的文档和文件夹 ID。
{% endhint %}
{% endtab %}
{% endtabs %}

## 删除备忘录

{% openapi src="/files/MHZeBzqvJFrULa5h2LlV" path="/mementos/{id}/" method="delete" %}
[rememberizer\_openapi.yml](https://1371168417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gvX7KIUy0DhcQETj8Ux%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=cce1ab0d-330f-4bed-b7da-5635aaf25472)
{% endopenapi %}

### 示例请求

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

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌，并将 `123` 替换为实际的备忘录 ID。
{% endhint %}

```javascript
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("备忘录删除成功");
  } else {
    console.error("删除备忘录失败");
  }
};

deleteMemento(123);
```

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌，并将 `123` 替换为实际的备忘录 ID。
{% endhint %}

```python
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("备忘录删除成功")
    else:
        print("删除备忘录失败")

delete_memento(123)
```

{% hint style="info" %}
要测试此 API 调用，请将 `YOUR_JWT_TOKEN` 替换为您的实际 JWT 令牌，并将 `123` 替换为实际的备忘录 ID。
{% endhint %}

{% endtabs %


---

# 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/zh-cn/kai-fa-zhe-zi-yuan/api-docs/mementos.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.
