上传文档进资料库
Body 为文件原始字节,参数走 query:?filename=必填&folder=可选&topicid=可选&confirm=1。filename 决定 MN 内名字;folder 为文档根相对路径;topicid 顺手绑集(以 addedToStudySet 为准);confirm=1 必填(确认前已传完一遍,直接带最省流量)。同名不覆盖。无按本机路径导入。
Body 为文件原始字节,参数走 query:?filename=必填&folder=可选&topicid=可选&confirm=1。filename 决定 MN 内名字;folder 为文档根相对路径;topicid 顺手绑集(以 addedToStudySet 为准);confirm=1 必填(确认前已传完一遍,直接带最省流量)。同名不覆盖。无按本机路径导入。
Authorization
bearerAuth AuthorizationBearer <token>
安装脚本写入 ~/.config/mn-bridge/token,或环境变量 MN_BRIDGE_TOKEN。不要带 Origin 头。
In: header
Query Parameters
filename*string
纯文件名,决定 MN 内名字;同名不覆盖
folder?string
文档根相对路径;不传落到用户上次浏览文件夹
topicid?string
顺手绑定的学习集,以 addedToStudySet 为准
confirm*integer
=1 确认写入(文件确认前已传完,直接带最省流量)
Request Body
application/octet-stream
TypeScript Definitions
Use the request body type in TypeScript.
body*file
文件原始字节;参数走 query(filename/folder/topicid/confirm)
Format
binaryResponse Body
curl -X POST "https://example.com/library/documents/upload?filename=string&confirm=0" \ -H "Content-Type: application/octet-stream" \ -d 'string'Empty