Getting Started with the Experience API (xAPI)

The easiest and quickest way to get started with the Experience API is to start sending and recording statements to our SCORM Cloud LRS. The best way to see how this works is to download our prototype activities and set them up to begin reporting statements.

 

Sending xAPI Statements to SCORM Cloud

After you’ve downloaded the prototype, find the ClientPrototypes folder and then the config.js.template file. Rename this file to just config.js, and then open it with a text editor. We need to replace some bits of text in the config.js file with the code that points your content to the your SCORM Cloud account and authenticates, and you’ll need to put in some user information. Don’t jump the gun though, there are special instructions, and you’ll want to use the code provided below.

You’ll need a SCORM Cloud AppID and secret key. To get these, log in to SCORM Cloud, click “Apps”, then click “Add Application.” Name your new application (The Experience PAPI Private LRS?), then click “Show App ID” next to your new application. You’ll use the AppID and Secret Key from this section of SCORM Cloud in the config.js file.

 

Now back to the config.js file in the ClientPrototypes folder that you downloaded. Please copy/paste the lines provided below to completely replace the existing lines in the config.js file, then fill in your own information.

The endpoint line should look like this (add your AppID from the SCORM Cloud apps page, and make sure to use a “/” after your AppID here):

The authUser line should look like this (insert your SCORM Cloud AppID once again):

The authPassword line should look like this (Insert your SCORM Cloud Secret Key):

The Actor line should look like this (replace with your email and first/last names, and make sure to add the “mailto:” part):

Save the file, and you’re ready to go. Run the “index.html” file found in the ClientPrototypes folder. Note: this isn’t the index.html file in the course folders, it’s the one in the ClientPrototypes folder. If you don’t see any configuration settings in the top section of the index.html page, then revisit your config.js file to make sure you got everything right.

Click on the different course types to initiate them. You’ll start generating xAPI statements to your SCORM Cloud account. You can view them by clicking on the “Statement Viewer button” or the “Report Sample button” in the index.html file, or in the Statement Viewer in the apps section of your SCORM Cloud account.

When viewing statements in the SCORM Cloud statement viewer, make sure you’ve selected the appropriate App in the dropdown menu on the top/right of the page (it’ll be the title of the app that you created in SCORM Cloud to access the AppID and secret key).

 

Again, if you’ve installed your prototypes on a web server, don’t forget to point your phone to that index.html file and see the beginnings of how xAPI works with mobile.

 
 
 

Want your own content to start reporting statements to your SCORM Cloud account or another LRS?

If you want to start using the xAPI with your content, we’ll work with you to make it happen.

 

Email us, and we’ll point you in the right direction.
info@scorm.com

 
 
 

 

A simpler way to deliver e-learning.

SCORM Cloud lets you deliver training where your learners live.




Try it Free