What Is xAPI: All You Need to Know to Get Started
The article will drive you through the need for an Experience API for uninterrupted learning experiences and seamless data flow into a learning ecosystem.
Join the DZone community and get the full member experience.
Join For FreeMany organizations are striving to deliver exceptional learning experiences to their learners because they have realized its long-term benefits. In order to transform the learning environment and confirm learner engagement & retention, vendors try to implement xAPI to their products. Integrating an xAPI requires comprehensive knowledge of statements, Documents, LRS, and the complete Ecosystem of an enterprise-grade learning. The article will drive you through the need for an Experience API for uninterrupted learning experiences and seamless data flow into a learning ecosystem.
Overview of an Experience API (xAPI)
Also referred to as Experience API, an xAPI is a specification that collects a wide range of data of user learning experiences.
An API first captures the individual or group's stream of activities in a consistent format, which is then securely communicated using xAPI's simple vocabulary.
You can say that xAPI is an advanced method that is more simple and more flexible to use than the earlier specifications. Offline learning, Experiential learning, social learning, virtual worlds, games, mobile learning solutions, collaborative learning, and more can be easily used through xAPI allowing easy to and fro of data.
Understanding the Functioning of xAPI
- An xAPI records people's interactions with other people, content, and more that trigger actions.
- These actions act as learning events or signals, which are necessary to record.
- The application triggers statements to a Learning Record Store(LRS), which are usually in the form of 'object, noun, or verb'.
- The LRS then stores and shares the statements with other LRSs that may be integrated with an LMS.
xAPI Statements
Did you know that statements define the format for specific moments in the stream of activity? But, why are we talking about the statements? Because this term is the bread and butter of the xAPI, a developer should be familiar with the term "Statements".
Statement 101
Statements can be usually expressed in the form of "actor, verb, and object". An actor is used to make an xAPI person-centric instead of making it system or ID centric. A verb is the URLs of the xAPI that are paired with a short display string to describe the event between the actors and the object statements. Last but not the least, Object, is the xAPI activity. However, with time the definition of the activity object changes, though it will still describe a new activity. Below is the example of all three - actor, object, and verb.
|
How to Build a Statement?
With the help of an xAPI LAB tool, you can build your own statement and send it to LRS.
The above images are snapshots of the statement generator. All you need to do is fill the empty boxes - desired actor, object, verb, etc and you can create a statement in minutes.
What Is the need for LRS?
Learning Record Store is the core of an xAPI ecosystem that stores, receives, and returns the xAPI statements. Learning Record Store is essential as it interacts during sending or retrieving learning activity data with other tools.
As aforementioned, an LRS aims to retrieve and store the data from multiple learning experiences users have. Additionally, this modern repository also enables better & efficient tracking of these experiences that can be derived in any form, such as actions completed in mobile apps, job performances, real-world activities, and much more. These stored data can further be shared to other systems seamlessly that can aid in advance reporting as well as support adaptive learning experiences.
You can either install LRS from vendors providing easy steps to run LRS or simply build your own LRS.
Building Your Own LRS
Only after understanding the completed xAPI specifications, can you then develop your own LRS. You would need to develop an activity provider, for which you can use parts of the xAPI specifications and then test against your LRS to ensure that it is done right. We will later learn about the activity provider, let’s first complete the understanding of the development of LRS.
Note: To find relevant Experience API (xAPI) specifications, you can look into https://github.com/adlnet/xAPI-Spec.
Other than specifications, you need to decide whether your LRS will be the component of your learning management system or a standalone enterprise LRS. Regardless of your choice, there are bare minimum functionalities that will help you develop an LRS.
The APIs
The xAPI is a bundle of collections of four RESTful APIs. However, the major focus is on the statement API, while a few also integrate Document API, which allows richer information storage. In order to develop LRS, all four APIs must be implemented.
Statement API sends and retrieves the Statements from LRS. This API is used to pull statements from LRS and fuel reporting and visualizations.
State API - This API is used by activity providers, like the scratch space to support learning activities.
Activity API stores the activity data in LRS. The data is fully described, and the LRS responsibly determines the best definition of each unique activity with the help of Activity API.
Agent API is similar to Activity and State APIs. However, it also adds additional data that helps LRS identify & connect persons in different ways.
Sharing Keys
As aforementioned, the state and activity profile, both have no specific structure or naming hence may face conflict. Here it is recommended to use IRIs to avoid such struggles where two Activity providers use the same key and assess the same data. Also to avoid data redundancy & storing the same data, Document IDs sharing keys are used to define the outline structure and format of the documents. A standard and unique Document ID should be used for Agent Profile Document so that the Activity providers use and follow the same structure.
ETags and Concurrency
Accessing the same document at the same time can accidentally overwrite the data. Here creating and using ETags can prevent such complexity. Every time Document is updated, LRS will create a new ETag which is sent to Activity Providers when they want to retrieve the data of the same document and store it. The best part of using ETags is LRS rejects the saving practice of the Document that comes without the latest ETags.
Security and Authentication
LRS needs to carry authentication for which two mechanisms are used - HTTPS and OAuth. HTTPS authentication is known worldwide. In order to implement oAuth, these five scenarios must fit right
- The application is known as OAuth consumer, and the person is known.
- The application is not a known oAuth, but the person is known.
- The application is known as OAuth consumer, and the person is not known.
- No authentication - Blank credentials.
Experience API has its own ways to authorize the process, such as through temporary credentials, tokens, and more. An LRS populates the authority portion of each statement based on the credentials. Specific requirements for constructing authority-based authentication require Statement Transfer (Retrieval) and Data Quality.
API Versioning and Resource Request
In every response from an LRS, there is a version header, that clarifies which versions of xAPI specifications are supported. LRS provides an "about" resource that returns JSON to identify the versions of the specifications.
Handling Past
There are three versions of xAPI specifications that are used differently by activity providers. In order for the LRS to support, it needs to be up-converted to the most recent versions of the specifications.
Credential Management
The LRS is required to have user and permission management in order to make complex decisions about security and permissions. The management includes user credentials, basic authorization combos, and building ways to register as OAuth consumers.
Other than management, LRS must be able to push-pull statement synchronization with other LRS, extract, view, and analyze data, manage authentication, merge actors, and support Agent API.
The Ecosystem of Enterprise Learning
The flexibility of elearning is that it can be self-directed by the learner and with xAPI, companies can adapt to the change in learning systems by tracking and integrating disparate learning experiences while organizing the collected data.
LRS integrated with an LMS must be compatible with activity providers and other external systems. Regardless of LRS being internal or external, it must be able to retrieve and use data from different sources, so you can correlate performance data with learning data.
With the help of modern xAPI, you build a seamless relationship between different LRS, regardless of different vendors and configurations.
Activity Providers
A tool or a system that generates learning experiences, job performances, and achievements' data for LRS. The amalgamation of learning technologies (social learning and interactive platforms) and e-learning courses provides wide data to send to the LRS to improve learning initiatives and business decisions.
Reports & Analytics
Where reports give historical information, Analytics go deeper for more meaningful data. They both compare and correlate the data retrieved from different resources and test the connections. For instance - a report will tell you that the learner has completed the course, and analytics will help you understand the impact of the action on the learner's performance on business.
Dashboards & Open Badges
A comprehensive view of information that shows learning activity, such as score on the recent assessment, line back to the last page bookmarked, aggregate information about learners, alerts, and digital credentials (Open Badges) awarded to any learner based on competency, achievement, or engagement.
Reporting
An innovative xAPI defines a query for API that delivers statements out from LRS and is to be used for simple reporting.
Simple Reporting - An xAPI specification dictates the process to fetch statements which are known as GET statements. This type is used to build a UI that displays data directly.
- A special parameter 'voidedStatementId' is used when the statement required is voided.
- 'related_activites' and 'related_agents' are determined by the filters applied by agent and activity.
- 'limit' shows a maximum number of statements LRS will return in a batch.
- 'attachments' defines whether an attachment file should be sent with statements or not.
- 'ascending' is for LRS to return the oldest and most useful statements first.
- 'format' dictates human-readable names and descriptions.
- 'canonical' format requests LRS to return internal definitions of objects.
Launching xAPI Activities
To ensure continuous and engaging learning experiences, companies need to track learners' experience to the learner's LRS. Hence the activity provider must know the learner and the data to be sent to LRS. These ways can help you get information -
- As the learner logs into the activity provider, the LRS details get configured immediately with the activity provider.
- As the learner logs through a single sign-on, the LRS may process or configure a part of data with the activity provider.
- The third scenario is when the activity provider is content, and the learner's & LRS details are sent to the launching system to the activity provider with the learner.
SCORM to xAPI
SCORM |
Experience API |
Can track a specific style of elearning courses uploaded on an LMS. |
Uses RESTful HTTPS requests. |
Supports JavaScript based content. |
Compatible with any programming language. |
Offers quick navigation, content aggregation, sequencing and run time communication. |
Extremely flexible with no to less limitations. |
Take advantage of JavaScript API with popups or frames. |
Tracks any learning experience seamlessly regardless of outside LMS activities. |
Strict definition of data communicated restrictive limits on length. |
Easy content aggregation & covers only communication. |
Many LMS developers, as well as organizations, are moving from SCORM to xAPI, offering better tracking, flexibility, compatibility with other programming languages while leveraging innovative and modern technologies to evolve with changing learning needs. Not to mention, that xAPI is rendering great opportunities to develop new systems and components. The xAPI supports a distributed architecture where statements can be propagated to diverse places hooked with streams of information. Surely, xAPI can deliver real value to the learners globally and connect the disconnected ones.
Published at DZone with permission of Scarlett Brown. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments