更新批注
const r = await mn.api('/notes/' + noteid + '/comments');
const c = r.comments.find(x => x.index === 1);
await mn.api('/notes/' + noteid + '/comments/1', {
method: 'POST',
body: {
text: '改过的内容。',
expectedPrefix: String(c.text || '').slice(0, 32),
confirm: true
}
});
{
"index": 2,
"noteid": "D3085422-2CB9-4B68-A78D-DEE351CF9C38",
"bridgeApiVersion": "0.91",
"remainingComments": 3,
"action": "update"
}卡片与摘录
更新批注
改写第 index 条批注。序号从 1 起,序号 0 是卡片自身正文,指向该序号的请求返回 422。
expectedPrefix 是该条批注当前内容的前 32 个字,读完到写之间内容已变则返回 409 COMMENT_CHANGED。
POST
/
notes
/
{noteid}
/
comments
/
{index}
更新批注
const r = await mn.api('/notes/' + noteid + '/comments');
const c = r.comments.find(x => x.index === 1);
await mn.api('/notes/' + noteid + '/comments/1', {
method: 'POST',
body: {
text: '改过的内容。',
expectedPrefix: String(c.text || '').slice(0, 32),
confirm: true
}
});
{
"index": 2,
"noteid": "D3085422-2CB9-4B68-A78D-DEE351CF9C38",
"bridgeApiVersion": "0.91",
"remainingComments": 3,
"action": "update"
}路径参数
卡片的 noteid。取自卡片命令响应的 noteid、POST /notes/batch-get 响应里 items[].noteid,或 GET /ui-state 的 state.focusnoteid。
批注序号,从 1 起。序号 0 是卡片自身正文,指向该序号的请求返回 422。
必填范围:
x >= 1请求体
application/json