移除一个标签
await mn.api('/notes/hashtags', {
method: 'POST',
body: {
noteIds: [noteid],
operation: 'remove',
hashtags: ['#VocabPending'],
confirm: true
}
});{
"persisted": true,
"operation": "remove",
"changedCount": 1,
"requested": [
{
"requestedNoteId": "5880F73A-3A6D-4464-9D6F-88F60285401E"
}
]
}卡片与摘录
更新卡片标签
一次给多张卡加标签、摘标签或替换标签,一次最多 200 张卡、100 个标签。
每个标签写一条完整的叶子路径,层级之间用 / 分隔。
摘标签时可以带上 includeDescendants,把下层的标签一并摘掉;加与替换不接受该项。
标签不能借改正文的途径写入,正文里出现标签控制行会被拒,响应会注明该用哪个接口。
一次提交多组互不相同的操作时用 patches。
POST
/
notes
/
hashtags
移除一个标签
await mn.api('/notes/hashtags', {
method: 'POST',
body: {
noteIds: [noteid],
operation: 'remove',
hashtags: ['#VocabPending'],
confirm: true
}
});{
"persisted": true,
"operation": "remove",
"changedCount": 1,
"requested": [
{
"requestedNoteId": "5880F73A-3A6D-4464-9D6F-88F60285401E"
}
]
}请求体
application/json
必填。由 MarginNote 自动补上。
目标卡片。批量形态使用 patches 时不写该项。
Maximum array length:
200增加、删除或替换。
可用选项:
add, remove, replace 标签,每项写一条完整的叶子路径,层级之间用 / 分隔。
Maximum array length:
100连同下层的标签一起摘掉。只有删除操作接受该参数,其余操作带上会被判非法。
批量形态,一次提交多组互不相同的操作。
Show child attributes
Show child attributes
响应
响应。可能还有未列出的字段。
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⚠️批量形态下按组返回的响应。