xAPI (also called Tin Can API) is a specification for tracking learning experiences. Here’s a starting point for writing and understanding xAPI statements.
Writing xAPI statements
An xAPI statement has three required parts: actor, verb, and object.
1 | { |
Key reading
- Five things a web developer needs to know about xAPI
- How to write an xAPI statement (tutorial)
- Deep dive: xAPI Context element
- xAPI context examples — Learning Pool
Common confusion: JSON vs JavaScript Object
xAPI statements are JSON, not JavaScript objects. The syntax looks similar, but there are important differences (all keys must be quoted strings, no trailing commas, no undefined):