Dev playground and updating cards

I have been playing around with the playground for update cards at:

https://developer.supernotes.app/api-reference/cards/update-cards?playground=open

I can enter the API key successfully, but I can’t work out where/how I should specify the card ID, and it seems the JSON is read-only.

Nothing has worked so far! Can anyone help?

Also, any advice on using the API to update card contents would be appreciated - I have so far managed to append, but not prepend or replace bits.

The cURL JSON of one of my attempts is below.

Many thanks
Mark

curl --request PATCH \
  --url https://api.supernotes.app/v1/cards \
  --header 'Api-Key: REDACTED' \
  --header 'Content-Type: application/json' \
  --data '{
  "[card_id]": {
    "parents": {
      "[card_id]": {
        "publishing_perms": null
      }
    },
    "membership": {
      "flash_memory": {
        "last_review": null
      },
      "view": {
        "card_sizing": null,
        "broadsheet_cols": null
      }
    }
  }
}'

Hi @Mark_Rainbow,

Ah yes the playground doesn’t support injecting the [card_id] in it’s pretty form editor. Replace the value of [card_id] in a cURL with an actual id and it’ll work. You can also edit multiple cards in one go, and only include the things you’d like to change. Like this example of liking two cards:

  --url https://api.supernotes.app/v1/cards \
  --header 'Api-Key: REDACTED' \
  --header 'Content-Type: application/json' \
  --data '{
  "b12ba262-b06c-4bf9-bc9a-8b78cf407e36": {
    "membership": {
      "liked": true
    }
  },
  "95e7e6c4-e7d2-4ac0-8d52-e532dac8a9b8": {
    "membership": {
      "liked": true
    }
  }
}'