SCORM Cloud has a few core concepts that are helpful to understand when building an integration against it.
Realms are the billing accounts of SCORM Cloud. Each realm either has a billing plan that determines its usage limits and monthly cost, or it is linked to another realm that has a billing plan. The API does not have any operations that work at the realm level. (There is no API to create or delete realms, for example.)
Applications are logically-separate containers within realms. The SCORM Cloud API operates within the context of an application: API credentials are an application ID (app ID for short) and a secret key.
Courses (or packages) are the unit of standardized learning content: a SCORM, AICC, cmi5, or Tin Can package. These are stored on a per-application basis.
Registrations are the logical association of a learner with a course. When an integrating system “assigns” a course to a learner, it will often create a registration in SCORM Cloud. Since courses are stored on a per-application basis, so too are registrations.
The relationship between these objects is shown in this graph:
Note that learners are not a distinct object in SCORM Cloud; there is neither an API to manage learners nor a learner repository in SCORM Cloud itself that tracks different learners. SCORM Cloud only knows about learners through the registration API, which includes the learner ID, first name, and last name.
User accounts do exist in SCORM Cloud, but these are strictly accounts used to access the management UI at cloud.scorm.com. There is no public API to manage them.
To demonstrate the above concepts: When a user signs up for a SCORM Cloud account at cloud.scorm.com, the system creates a default realm for them. By default, new realms are created with two applications in them. One application (named “SCORM Cloud”) is used internally by the website, and the other application (named “Initial Application for …”) is left empty. No courses or registrations are in a new account by default.
The user might select “Add Content” on the website and import a SCORM package. This package (course) will be added to the SCORM Cloud application. The user can then launch the package in the testing sandbox (the course info page) – this will create a no-charge sandbox registration within the SCORM Cloud application, then launch that registration.
API Quick Start
This document contains information on Getting Started with the SCORM Cloud API.
The first step is to sign up for a SCORM Cloud account. As explained in Core Concepts, this will create a single realm with two applications by default. The Trial billing plan is free, albeit with some restrictions:
- You may only have 10 active registrations at one time.
- You may only have 100 MB of course content.
While developing an integration with SCORM Cloud, we recommend deleting courses and registrations once you’re finished using them, so as to stay below the trial limits. Alternately, you can upgrade your account to a paid level. See SCORM Cloud Pricing for more information.
Once you’ve got a SCORM Cloud account, log into it and go to the Apps / API page. The API exposes and allows the management of information inside each of these applications.
Your API credentials are an Application ID (App ID) and a Secret Key. Click “Details” on one of your applications. The App ID for that application is at the top of the page. The secret keys are under Authorization Keys. Any of the secret keys will work for the API.
Take note of an app ID and secret key; we’ll use them later.
We provide API client libraries for some common programming languages:
If you’re using one of these languages, we strongly recommend using these libraries as at least a starting point. If not, see Communication Format for the communication format of the SCORM Cloud API. (We recommend using the client libraries as a reference when implementing your own client.)
The client libraries do not necessarily have every API call implemented, although we’ve tried to implement the most common, and we’re adding missing API calls as people report them. The Python library in particular needs improvement; it’s on our roadmap.
Fortunately, adding new API calls to the libraries is fairly straightforward.
It’s worth understanding that SCORM Cloud’s API is based around simple HTTP GETs or POSTs, although it’s not RESTful. API calls end up looking like:
When working with our client libraries manually, building URLs by hand is not necessary; however, there are circumstances where it’s useful to understand that an API call is a GET or POST request to a particular URL.
Here’s where the rubber meets the road, so to speak. Each of the client libraries has its own README that explains how to configure the library and gives some sample API calls using that library. Below, we’ll look at some sample code using the Java client library.
We have demo applications for Java and .NET, which can be useful to reference, but it’s generally easier to try some simple code in your own development environment. Our PHP library also has asamples directory in it.
Each of our client libraries uses a
Configuration object to store the API credentials and configuration. Here’s how the Java one works:
Configuration cfg = new Configuration( "https://cloud.scorm.com/EngineWebServices", "your app ID", "your secret key", "test.app.1.0");
Configuration has four parameters:
- Service URL – this is a relic of previous product iteration and should usually be set to the value above (unless you cannot support HTTPS for some reason).
- App ID – the application ID you noted above
- Secret Key – one of the secret keys you noted above
- Origin String – used for debugging on the SCORM Cloud developers’ side; it’s useful for this value to be your application or company name, but it doesn’t have to be.
With this, you can configure the
ScormCloud convenience singleton:
The ScormCloud class is a convenience class to provide access to a variety of pre-built methods. For example, to check if a course exists,
boolean exists = ScormCloud.getCourseService().Exists("some course id");
some course id would, of course, be some course ID. We recommend looking at the README for a specific client library for more information, or contact us at Support.
Clients are Wrappers
The API client libraries are relatively thin wrappers around the real web API, which is documented at API Reference. The above
.getCourseService().Exists corresponds to the “real” course service’s existsmethod. That is: the web documentation is authoritative, and so when we link to API methods in the documentation, we’re linking to the authoritative web API documentation. Client libraries (usually) have matching methods already implemented.
The ScormCloud class just offers convenient access to already implemented API calls. However, using the
ServiceRequest class, we can directly make any API call in SCORM Cloud, even one that’s not already implemented in the library itself. For example,
ServiceRequest request = new ServiceRequest(cfg); request.getParameters().add("courseid", "some course id"); Document response = request.callService("rustici.course.exists"); Element resultElem = (Element) (response.getElementsByTagName("result").item(0)); return Boolean.parseBoolean(resultElem.getTextContent());
This block of code calls the
rustici.course.exists method, the same as the above, directly. This is actually the implementation of the
CourseService#Exists method in the Java client library.
The above Java examples are written in Java, but all of our client libraries implement effectively the same set of classes.
If you have any questions, just send us a message at email@example.com