获取一张摘录图
const got = await mn.api('/notes/batch-get', { method: 'POST', body: { noteIds: [noteid] } });
const part = (got.items[0].parts || [])[0];
const r = await fetch('/bridge/v1/notes/' + noteid + '/content/' + part.contentId + '?maxEdge=880');
document.querySelector('#shot').src = URL.createObjectURL(await r.blob());"<string>"卡片与摘录
获取卡片媒体文件
按 contentId 取回卡片上某一项二进制内容的原始字节。contentId 取自
POST /notes/batch-get 响应里 items[].parts[].contentId。
返回的是内容本身,不是 JSON,因此该接口要用 fetch 原语读取。
GET
/
notes
/
{noteid}
/
content
/
{contentId}
获取一张摘录图
const got = await mn.api('/notes/batch-get', { method: 'POST', body: { noteIds: [noteid] } });
const part = (got.items[0].parts || [])[0];
const r = await fetch('/bridge/v1/notes/' + noteid + '/content/' + part.contentId + '?maxEdge=880');
document.querySelector('#shot').src = URL.createObjectURL(await r.blob());"<string>"路径参数
卡片的 noteid。取自卡片命令响应的 noteid、POST /notes/batch-get 响应里 items[].noteid,或 GET /ui-state 的 state.focusnoteid。
二进制项的身份。取自 POST /notes/batch-get 响应 items[].parts[].contentId,或 GET /documents/{bookmd5}/pages/{index}/parts 响应里的 contentIds。
查询参数
返回图片的最长边。
必填范围:
64 <= x <= 4096取合成图还是只取底层。
可用选项:
composite, base 响应
图片或音视频的原始字节。
The response is of type file.