Skip to content

Save quiz attempt

Saves the answers given so far to the open attempt, replacing those saved before, so it resumes on any device.

Needs the quiz:write scope.

Call

  • Tool: save_attempt
  • Scope: quiz:write
  • Writes, and may change or remove what is there.
  • Acts on a store.

Arguments

Name Type Required Description
product object Yes
attempt object Yes
answers object Yes Each text answer at most 4000 characters; replaces the answers saved before.
preview string No A token a seller made for the quiz’s product’s page, which opens the quiz of a published entry of the product unpublished, or for the quiz’s entry, which opens it unpublished too, gated as ever; with it, a sitting on any quiz it does not open is not_found preview.
{
  "type": "object",
  "properties": {
    "product": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "id"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "slug": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "slug"
          ],
          "additionalProperties": false
        }
      ]
    },
    "attempt": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false
    },
    "answers": {
      "description": "Each text answer at most 4000 characters; replaces the answers saved before.",
      "type": "object",
      "properties": {},
      "additionalProperties": {
        "anyOf": [
          {
            "type": "boolean"
          },
          {
            "type": "string",
            "maxLength": 4000
          },
          {
            "type": "number"
          },
          {
            "type": "null"
          }
        ]
      },
      "maxProperties": 500
    },
    "preview": {
      "description": "A token a seller made for the quiz's product's page, which opens the quiz of a published entry of the product unpublished, or for the quiz's entry, which opens it unpublished too, gated as ever; with it, a sitting on any quiz it does not open is `not_found` `preview`.",
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    }
  },
  "required": [
    "product",
    "attempt",
    "answers"
  ],
  "additionalProperties": false
}

Answer

Name Type Required Description
attempt object Yes
answers object Yes

The answer’s full shape is on its API reference page.

Type to search…

↑↓ navigate↵ selectEsc close