Kanorio

API reference

Units

Customer API: POST /units/{id}/open, POST /units/{id}/quiz

Base URL https://{site}/api/v1/customerErrorsPagination

Parameters

  • idstring · pathrequired
  • localestring · query

    Locale code (any letter case) or URL prefix of a live locale. Omitted: the customer's own locale (Contact.locale, set by their last checkout, sign-in or form submission), falling back to the site's primary locale. The unit title in the response follows it.

Request body

  • mode"read" | "download"

Response 200

  • mode"read" | "download"required
  • urlstringrequired

    Signed URL of the original file (download, or playback when there is no streaming version).

  • expiresInintegerrequired

    Seconds. Videos: 1.5 × duration + 10 minutes, between 15 minutes and 4 hours; other files: 600.

  • titlestring | nullrequired
  • fileNamestringrequired
  • mimeTypestring | nullrequired
  • allowDownloadbooleanrequired
  • renditionsobject[]

    Playback sources: original, plus hls (adaptive-streaming master manifest on a signed path, play this one when present), thumbnails (progress-bar storyboard VTT) and poster for transcoded videos. Same validity as expiresIn.

  • renditions[].kind"original" | "mp4" | "hls" | "poster" | "thumbnails"required
  • renditions[].urlstringrequired
  • renditions[].mimeTypestringrequired
  • renditions[].widthinteger
  • renditions[].heightinteger
  • renditions[].bytesinteger
  • posterstring | null
  • thumbnailsstring | null
  • streaming"none" | "partial" | "ready"

    partial: only the lowest quality is in the manifest yet; ready: all qualities.

Errors

  • UNIT_NOT_FOUND 404
  • NO_FILE 404
  • FILE_NOT_PROTECTED 409
  • FORBIDDEN 403
  • DOWNLOAD_NOT_ALLOWED 403
  • NOT_RELEASED 403
  • EXPIRED 403
  • LOCKED 403
curl -X POST "https://{site}/api/v1/customer/units/{id}/open" \
  -H "Authorization: Bearer $KANORIO_CUSTOMER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Parameters

  • idstring · pathrequired

Request body

  • answersobjectrequired

    question id → chosen option ids

Response 200

  • scoreintegerrequired
  • correctintegerrequired
  • totalintegerrequired
  • passedbooleanrequired
  • perQuestionobjectrequired
  • attemptsUsedintegerrequired
  • maxAttemptsinteger | nullrequired
  • canRetrybooleanrequired
  • revealobject | nullrequired
  • reveal.questionsobject[]required
  • reveal.questions[].idstringrequired
  • reveal.questions[].correctOptionIdsstring[]required
  • reveal.questions[].explanationstring | nullrequired
  • unit"not_started" | "in-progress" | "completed"required
  • deliverableobjectrequired
  • deliverable.idstringrequired
  • deliverable.percentnumberrequired
  • deliverable.completedbooleanrequired
  • deliverable.completedAtstring | null
  • deliverableJustCompletedbooleanrequired

Errors

  • UNIT_NOT_FOUND 404
  • VALIDATION 400
  • NOT_A_QUIZ 409
  • QUIZ_NOT_READY 409
  • NO_ATTEMPTS_LEFT 403
  • LOCKED 403
curl -X POST "https://{site}/api/v1/customer/units/{id}/quiz" \
  -H "Authorization: Bearer $KANORIO_CUSTOMER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'