# 將內容記住到 Rememberizer

{% openapi src="/files/WF90zszaISusKGEBimez" path="/documents/memorize/" method="post" %}
[rememberizer\_openapi.yml](https://2492455604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTVKmtXKPeA8gAZJsuGLA%2Fuploads%2Fgit-blob-77b6137eeb641262ec8e531c78123c02b825b865%2Frememberizer_openapi.yml?alt=media\&token=3b4a9db2-4dd7-440f-b670-9555703d351d)
{% endopenapi %}

## 範例請求

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

```bash
curl -X POST \
  https://api.rememberizer.ai/api/v1/documents/memorize/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "重要資訊",
    "content": "這是我希望 Rememberizer 記住的重要內容。"
  }'
```

{% hint style="info" %}
將 `YOUR_JWT_TOKEN` 替換為您的實際 JWT 令牌。
{% endhint %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript
const memorizeContent = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/documents/memorize/', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: '重要資訊',
      content: '這是我希望 Rememberizer 記住的重要內容。'
    })
  });
  
  if (response.status === 201) {
    console.log("內容成功儲存");
  } else {
    console.error("儲存內容失敗");
    const errorData = await response.json();
    console.error(errorData);
  }
};

memorizeContent();
```

{% hint style="info" %}
將 `YOUR_JWT_TOKEN` 替換為您的實際 JWT 令牌。
{% endhint %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def memorize_content():
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN",
        "Content-Type": "application/json"
    }
    
    payload = {
        "name": "重要資訊",
        "content": "這是我希望 Rememberizer 記住的重要內容。"
    }
    
    response = requests.post(
        "https://api.rememberizer.ai/api/v1/documents/memorize/",
        headers=headers,
        data=json.dumps(payload)
    )
    
    if response.status_code == 201:
        print("內容成功儲存")
    else:
        print(f"儲存內容失敗: {response.text}")

memorize_content()
```

{% hint style="info" %}
將 `YOUR_JWT_TOKEN` 替換為您的實際 JWT 令牌。
{% endhint %}
{% endtab %}
{% endtabs %}

## 請求參數

| 參數      | 類型 | 描述                               |
| ------- | -- | -------------------------------- |
| name    | 字串 | **必填。** 要儲存內容的名稱。                |
| content | 字串 | **必填。** 要儲存在 Rememberizer 的文本內容。 |

## 回應

成功的請求返回 201 已建立狀態碼，且沒有回應主體。

## 錯誤回應

| 狀態碼 | 描述                    |
| --- | --------------------- |
| 400 | 錯誤的請求 - 缺少必要的欄位或無效的參數 |
| 401 | 未授權 - 無效或缺失的身份驗證      |
| 500 | 內部伺服器錯誤               |

## 使用案例

此端點特別適用於：

1. 儲存您想要稍後訪問的重要筆記或資訊
2. 添加通過集成數據源無法獲得的內容
3. 手動添加需要可搜索的信息
4. 為訪問您的知識庫的 LLM 添加上下文信息

儲存的內容可以通過搜索端點進行搜索，並可以包含在紀念品中。


---

# Agent Instructions: 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:

```
GET https://docs.rememberizer.ai/zh-hk/kai-fa-zhe-zi-yuan/api-docs/memorize-content-to-rememberizer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
