PUT
/api/v1/memories/{memory_id}
更新记忆 (Update Memory)
请求参数 (Request Body)
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| text | string | 是 | 新的记忆内容。 |
| user_id | string | 是 | 用户的唯一标识符。 |
示例代码
cURL
curl -X PUT "https://api.momemory.cn/api/v1/memories/mem_8f7d3a2..." \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer YOUR_API_KEY" \\
-d '{
"text": "会议时间改为下午4点",
"user_id": "user_123456"
}'
Python
import requests
url = "https://api.momemory.cn/api/v1/memories/mem_8f7d3a2..."
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
}
data = {
"text": "会议时间改为下午4点",
"user_id": "user_123456"
}
response = requests.put(url, json=data, headers=headers)
print(response.json())
响应示例
{
"id": "mem_8f7d3a2...",
"content": "会议时间改为下午4点",
"updated_at": "2024-03-20T16:00:00Z",
"state": "active"
}
在 GitHub 上编辑此页面
此页面有帮助吗?