Skip to main content

Content preview API

Lets aztec_staff and admin open any Published Version as a learner would see it, in a chosen language, with no assignment. A preview writes no learner records: no assignment check, no cmi5 registration, no statements under any learner. POST /api/launch stays learner-only.

OperationRouteNotes
Open a previewPOST /api/previewBody: versionId (required) and locale (optional, for example es-US). Returns the same body as POST /api/launch: launchUrl, packageUrl, packageUrlExpiresAt, registration, lrsEndpoint, fetchUrl, variant, fallbackUsed and notice.
cmi5 fetchPOST /api/launch/fetch?token=Same call as for a launch. A preview token returns a preview credential.

Errors​

401 not signed in. 403 any role other than aztec_staff or admin. 404 unknown Version. 422 the Version is Draft or Retired, the locale is not a valid language tag, or the Version has no unit that can be previewed. 503 URL signing is unavailable, with friendly copy.

Fetch refusals are the same as for launch: HTTP 200 with error-code 1 already used, 2 expired (5 minutes after the preview), 3 invalid.

Rules​

  • The signed package URL lasts 15 minutes. The fetch token is single-use and lasts 5 minutes.
  • The Variant comes from ResolveVariant. When it falls back to another locale, fallbackUsed is true and notice is the same text as for a launch.
  • The first unit of the Version is previewed. registration is a random value that is never stored.
  • Content calls the xAPI endpoint with a preview credential. Statements and state writes return success and nothing is stored. State reads find nothing, except LMS.LaunchData, which is generated with launchMode Browse and moveOn NotApplicable.
  • A Version retired while a preview is open keeps working; the next preview request returns 422.

Telemetry​

Events: preview requested, succeeded, denied (with reason), Variant fallback used. Each carries the caller's role and never a learner.