我正在尝试使用 Ankconnect 添加注释,卡片组和模型存在并且字段正确,但我只是返回“null”(并且未添加卡片)。
运行这个 bash 脚本
echo "---------- The deck exists:"
curl localhost:8765 -X POST -d '{
"action": "getDeckConfig",
"version": 6,
"params": {
"deck": "Foo"
}
}'
echo "---------- The model exists:"
curl localhost:8765 -X POST -d '{
"action": "modelFieldNames",
"version": 6,
"params": {
"modelName": "Auto-generated"
}
}'
echo "---------- But adding a card fails:"
curl localhost:8765 -X POST -d '{
"action": "addNotes",
"version": 6,
"params": {
"notes": {
"deckName": "Foo",
"modelName": "Auto-generated",
"fields": {
"Question": "why?",
"Answer": "because!",
"Card ID": "foo"
},
"options": {
"allowDuplicate": true
},
}
}
}'
产生这些结果
---------- 套牌存在:
{"result": {"dyn": false, "usn": 82, "timer": 0, "replayq": true, "name": "Default", "id": 1, "lapse": {"mult": 0.0, "minInt": 1, "delays": [10], "leechAction": 0, "leechFails": 8}, "autoplay": true, "rev": {"hardFactor": 1.2, "ivlFct": 1.0, "ease4": 1.3, "perDay": 200, "fuzz": 0.05, "minSpace": 1, "bury": false, "maxIvl": 36500}, "mod": 1560476298, "maxTaken": 60, "new": {"ints": [1, 4, 7], "perDay": 20, "delays": [1, 10], "order": 1, "initialFactor": 2500, "bury": false, "separate": true, "LBGIMinBefore": 1, "LBGIMinAfter": 1, "LBEIMinBefore": 4, "LBEIMinAfter": 4}}, "error": null}
---------- 模型存在:
{"result": ["Question", "Answer", "Card ID"], "error": null}
---------- 但是添加卡失败:
null