Anki API updating Card is not working

API Log:

[request]
{
“action”: “updateNoteFields”,
“params”: {
“note”: {
“fields”: {
“Back”: “Updated back content”,
“Front”: “Updated front content”
},
“noteId”: 1689527111359
}
},
“version”: 6
}

[reply]
{
“error”: “‘id’”,
“result”: null
}

Creation of the card works well, but updating existing card gives this error. I have checked the ID and it is correct:
[request]
{
“action”: “notesInfo”,
“params”: {
“notes”: [
1689527111359
]
},
“version”: 6
}

[reply]
{
“error”: null,
“result”: [
{
“cards”: [
1689527111360
],
“fields”: {
“Back”: {
“order”: 1,
“value”: “And the grain is scattered.”
},
“Front”: {
“order”: 0,
“value”: “Och p\u00e5 s\u00e5 s\u00e4tt sprider de k\u00e4rnorna [sound:rec1689540508.mp3]”
}
},
“modelName”: “Basic”,
“noteId”: 1689527111359,
“tags”:
}
]
}

Maybe the ID is too large and I need to clean out anki and reset this index?

I moved your post to the add-ons section since it’s about the AnkiConnect add-on.

The ID looks OK to me.

Check out the documentation of the updateNoteFields API. You should use “id” instead of “noteId”.

1 Like

Tried:

[request]
{
“action”: “updateNoteFields”,
“params”: {
“note”: {
“fields”: {
“Back”: “Updated back content”,
“Front”: “Updated front content”
},
“id”: 1689527111359
}
},
“version”: 6
}

[reply]
{
“error”: null,
“result”: null
}

Great , it worked. Thanks for helping me to get rid of that error!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.