Skip to main content

Player credential and statements

The branded player calls POST /api/launch and plays the returned launchUrl in a sandboxed iframe. The response includes two fields for the player's own xAPI calls.

FieldMeaning
playerCredentialA bearer credential for /xapi/statements. It covers one registration and one actor, and is independent of the credential the content receives.
playerCredentialExpiresAtWhen the credential expires, at most 8 hours after issue.

Statements from the player​

  • POST {lrsEndpoint}/statements with the player credential as the bearer token in the Authorization header, and no cookies. A session cookie alone gets 401.
  • A heartbeat uses the verb https://aztecsoftware.com/xapi/verbs/heartbeat, every 30 seconds while the tab is visible and focused.
  • A failed statement waits in a sessionStorage queue for its registration (up to 500). It is resent oldest first with its original statement ID, when the browser is online or the tab is visible again. A repeat of a stored ID (409) counts as delivered.
  • When the queue is full, the oldest heartbeat is dropped, or the oldest statement if none is a heartbeat. Entries past the credential's expiry are dropped.

CORS​

The /xapi endpoints accept cross-origin requests from the content hostname and the app hostname.

Errors​

POST /api/launch returns 401 session_expired, 403, 404, 422 and 503. 503 also covers a failure to issue the player credential. The player shows friendly copy for each.