按文档顺序列出卡片
// 不要自行按 startPage 排序,页码在摘录子笔记上,卡自身没有页码
const tree = await mn.api('/study-sets/' + topicid + '/tree?sort=document');
const cards = tree.nodes;
mn.log(tree.nodeTotal, tree.nextCursor, tree.truncated);
// 翻下一页时把 nextCursor 带返回去
if (tree.nextCursor) {
const more = await mn.api('/study-sets/' + topicid
+ '/tree?sort=document&cursor=' + tree.nextCursor);
}{
"topicid": "77012CA0-48E8-4D29-B5F5-1EEA927AE086",
"bridgeApiVersion": "0.61",
"nodeTotal": 15,
"nodes": [
{
"noteid": "BCC8D945-7585-425A-9FDF-E24C6503F628",
"parent": null,
"depth": 0,
"folded": false,
"hasInk": false,
"title": "一元一次方程与百分数·练习A",
"isReference": 0,
"preview": "一元一次方程与百分数·练习A",
"childCount": 0,
"kind": "framework"
},
{
"noteid": "055E30EF-A59E-44AC-9459-997EEB5481A6",
"parent": null,
"depth": 0,
"folded": false,
"hasInk": false,
"title": "理工公式对照材料",
"isReference": 0,
"preview": "理工公式对照材料",
"childCount": 1,
"kind": "framework"
},
{
"noteid": "8AEDDBF9-BDD8-4D91-AC31-5DEAC8DF1DA1",
"parent": "055E30EF-A59E-44AC-9459-997EEB5481A6",
"depth": 1,
"folded": false,
"hasInk": false,
"title": "(1.2)",
"isReference": 1,
"preview": "(1.2)",
"childCount": 0,
"kind": "card"
}
],
"nextCursor": null
}学习集与卡组
获取学习集脑图
读整个学习集的脑图结构、标题与逻辑属性。
节点是扁平数组,父子关系靠每一项的 parent 自行组合,没有嵌套的下层数组。
要按文档顺序排列时带 sort=document。不要自行按页码排序:摘录与摘题产出的卡片没有页码,
页码记在该题的摘录子笔记上。带该参数时由 MarginNote 排序,结果与界面上按页码排序一致,
每个节点还会补上 docPage 与 docBookmd5。排序在切片之前对完整序列执行,跨页顺序因此正确。
翻页用 limit 与 cursor,响应里的 nextCursor 为 null 表示已到末尾。
达到遍历上限时 walkLimitReached 为真,为真时才表示读到末页也取不全。
GET
/
study-sets
/
{topicid}
/
tree
按文档顺序列出卡片
// 不要自行按 startPage 排序,页码在摘录子笔记上,卡自身没有页码
const tree = await mn.api('/study-sets/' + topicid + '/tree?sort=document');
const cards = tree.nodes;
mn.log(tree.nodeTotal, tree.nextCursor, tree.truncated);
// 翻下一页时把 nextCursor 带返回去
if (tree.nextCursor) {
const more = await mn.api('/study-sets/' + topicid
+ '/tree?sort=document&cursor=' + tree.nextCursor);
}{
"topicid": "77012CA0-48E8-4D29-B5F5-1EEA927AE086",
"bridgeApiVersion": "0.61",
"nodeTotal": 15,
"nodes": [
{
"noteid": "BCC8D945-7585-425A-9FDF-E24C6503F628",
"parent": null,
"depth": 0,
"folded": false,
"hasInk": false,
"title": "一元一次方程与百分数·练习A",
"isReference": 0,
"preview": "一元一次方程与百分数·练习A",
"childCount": 0,
"kind": "framework"
},
{
"noteid": "055E30EF-A59E-44AC-9459-997EEB5481A6",
"parent": null,
"depth": 0,
"folded": false,
"hasInk": false,
"title": "理工公式对照材料",
"isReference": 0,
"preview": "理工公式对照材料",
"childCount": 1,
"kind": "framework"
},
{
"noteid": "8AEDDBF9-BDD8-4D91-AC31-5DEAC8DF1DA1",
"parent": "055E30EF-A59E-44AC-9459-997EEB5481A6",
"depth": 1,
"folded": false,
"hasInk": false,
"title": "(1.2)",
"isReference": 1,
"preview": "(1.2)",
"childCount": 0,
"kind": "card"
}
],
"nextCursor": null
}路径参数
查询参数
响应
200 - application/json
脑图。节点是扁平数组,父子关系靠 parent 字段表示。
整个学习集的脑图。节点是扁平数组,父子关系由每项的 parent 写出,没有嵌套的 children。
翻页时带 limit 与 cursor;要按文档顺序排列时带 sort=document,此时顶层多出 sort,
节点上多出 docPage 与 docBookmd5。