UserService · UserService_ExportMemos
基于协议生成的参考。授权与实例策略仍然生效。结构描述继承自 MIT 许可的应用接口定义;本站不会向真实服务执行示例。
访问权限
仅限所有者:路径中的用户必须是已认证调用者;实例管理员身份不允许在此代替其他账号操作。
保存原始归档
成功返回原始 ZIP 字节,包含用户自己的评论、归档笔记与附件文件。不要调用 response.json() 或期待 HttpBody JSON 包装。声明的 */* 媒体类型不够具体,应以实际 Content-Type 为准。下方 MEMOS_USERNAME 是当前账号用户名。归档可能包含私密内容,应私密保存。
curl --fail-with-body \
-H "Authorization: Bearer $MEMOS_TOKEN" \
--output memos-export.zip \
"$MEMOS_URL/api/v1/users/$MEMOS_USERNAME:exportMemos"请求
ExportMemos writes every memo the user created, with comments, archived memos, and attachment files, as a Memos export file (a ZIP file, see docs/design/memos-export-format.md). Only the user may export their own memos. The body is the archive; content_type is its media type.
GET
/api/v1/users/{user}:exportMemos参数
| 名称 / 位置 | 类型 / 是否必需 | 描述 |
|---|---|---|
userpath | string 必需 | The user id. |
请求体
未声明请求体。
响应
200 · OK
*/* · —
default · Default error response
application/json · Status
完整操作定义
下方保留全部已声明约束、媒体类型和响应细节。结构引用链接到完整定义。
展开 JSON 定义
{
"tags": [
"UserService"
],
"description": "ExportMemos writes every memo the user created, with comments, archived\n memos, and attachment files, as a Memos export file (a ZIP file, see\n docs/design/memos-export-format.md). Only the user may export their own\n memos. The body is the archive; content_type is its media type.",
"operationId": "UserService_ExportMemos",
"parameters": [
{
"name": "user",
"in": "path",
"description": "The user id.",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {}
}
},
"default": {
"description": "Default error response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Status"
}
}
}
}
}
}