更新标题
const got = await mn.api('/notes/batch-get', { method: 'POST', body: { noteIds: [noteid] } });
const before = String(got.items[0].title || '').slice(0, 32);
await mn.api('/notes/' + noteid + '/title', {
method: 'POST',
body: { text: 'photosynthesis', expectedPrefix: before, confirm: true }
});{
"bridgeApiVersion": "0.91",
"anchored": true,
"kind": "note",
"field": "title",
"noteid": "D3085422-2CB9-4B68-A78D-DEE351CF9C38"
}卡片与摘录
更新卡片标题
改该卡的标题。字段名是 text,不是 title。清空标题传空串。
expectedPrefix 是当前标题的前 32 个字,为空传空串。内容已变时返回 409。
该接口与改正文走同一个处理器,缺字段时返回的码都是 INVALID_INPUT,分辨所缺的项
看 message。
POST
/
notes
/
{noteid}
/
title
更新标题
const got = await mn.api('/notes/batch-get', { method: 'POST', body: { noteIds: [noteid] } });
const before = String(got.items[0].title || '').slice(0, 32);
await mn.api('/notes/' + noteid + '/title', {
method: 'POST',
body: { text: 'photosynthesis', expectedPrefix: before, confirm: true }
});{
"bridgeApiVersion": "0.91",
"anchored": true,
"kind": "note",
"field": "title",
"noteid": "D3085422-2CB9-4B68-A78D-DEE351CF9C38"
}路径参数
卡片的 noteid。取自卡片命令响应的 noteid、POST /notes/batch-get 响应里 items[].noteid,或 GET /ui-state 的 state.focusnoteid。
请求体
application/json