A SCORM Cloud application ID
The secret key for the given application ID
An auth scope or space separated list of scopes, e.g. "write:course read:registration". This will be the default scope used if a method on the client is invoked without specifying an explicit scope in the method's Options
The amount of time, in seconds, after which auth tokens should expire. If unspecified, it will default to 3600 (1 hour)
Attempt to authenticate and store an auth token, associated with a given scope
ScormClientError with an httpStatus
of 401 on authentication failure
An auth scope or space separated list of scopes
Optional
expiry: numberThe amount of time, in seconds, after which the auth token should expire. If unspecified, it will use the default value provided in the constructor.
Get a launch link, which is a relatively short lived url, used to launch the course for a given registration. Launch links are meant as a way to provide access to your content. When a learner visits the link, the course will be launched and registration progress will start to be tracked.
The registration ID for which to create and return a launch link
The URL the application should redirect to when the learner exits or completes a course. Alternatively one of the following keywords can be used:
If an invalid url is specified, the Message.html page will be loaded
LaunchLinkOptions
Creates a new registration. Registrations are the billable unit in SCORM Cloud, and represents the link between a learner and a course. A registration will contain a few pieces of information such as learner identifiers, the id of the course being registered for, and several other optional fields.
A registration must be tied to a specific course at creation time. When the registration is "launched" (see createLaunchLink), the course specified at creation time will be launched.
API Method - CreateRegistration
ScormClientError if an invalid request was made, or an error encountered, or if the referenced course or learner does not exist, or if creating a duplicate registration
An ID for this registration
The course ID for which the learner should be registered
The details of the learner, at minimum a learner ID should be specified
RegistrationOptions
Deletes the specified course. When a course is deleted, so is everything connected to the course. This includes:
ScormClientError if an invalid request was made, or an error encountered, or if the referenced course does not exist
The course ID
Options
Deletes the specified version of the course. If deleting the last remaining version of the course, the course itself will be deleted and no longer accessible. When a course is deleted, so is everything connected to the course. This includes:
API Method - DeleteCourseVersion
ScormClientError if an invalid request was made, or an error encountered, or if the referenced course does not exist
The course ID
The version number
Options
Deletes the specified registration. This will also delete all instances of the registration.
API Method - DeleteRegistration
ScormClientError if an invalid request was made, or an error encountered, or if the referenced registration does not exist
The registration ID
Options
Returns detailed information about the course.
ScormClientError if an invalid request was made, or an error encountered
The requested Course, or undefined
if the course was not found
The course ID
CourseFetchOptions
Check the status of a course import. This can be called incrementally to check the progress of a call to any of the import options. Note: The import job ID is only valid for one week after the course import finishes.
API Method - GetImportJobStatus
ScormClientError if an invalid request was made, or an error encountered
A ImportJobResult, or undefined
if no job result was not found
The import job ID
Options
TODO: Test this function to see what happens with non-existent courses and/or course versions and confirm what is return and what is thrown. Update the function to handle scenarios appropriately ...
Returns information about all versions of the course. This can be useful to see information such as registration counts and modification times across the versions of a course.
API Method - GetCourseVersions
ScormClientError if an invalid request was made, or an error encountered,
An array of Course, or an empty array if no courses were found. This method does not support pagination, all versions will be returned
The course ID
CourseVersionFetchOptions
Returns a list of courses. Can be filtered to provide a subset of results.
This request is paginated and will only provide a limited amount of resources at a time. If there are more results to be collected, a more token provided with the response which can be passed to get the next page of results. When passing this token, no other filter parameters can be sent as part of the request. The resources will continue to respect the filters passed in by the original request.
ScormClientError if an invalid request was made, or an error encountered
A CourseQueryResponse that has a property named courses
, which is an array
of type Course, or an empty array if no courses were found. It also includes a
'more
' property which, if present, can be used to retrieve the next paginated set of results
CourseQueryOptions
Returns detailed information about the registration. This includes completion status, time taken, score, and pass/fail status.
The registration ID for which to return progress
RegistrationFetchOptions
This is an overloaded method for getRegistration, and is exactly the same thing. It exists purely to provide a method named in similar fashion to the official API.
The registration ID for which to return progress
RegistrationFetchOptions
Returns a list of registrations. Can be filtered to provide a subset of results.
This request is paginated and will only provide a limited amount of resources at a time. If there are more results to be collected, a more token provided with the response which can be passed to get the next page of results. When passing this token, no other filter parameters can be sent as part of the request. The resources will continue to respect the filters passed in by the original request.
ScormClientError if an invalid request was made, or an error encountered
A RegistrationQueryResponse that has a property named registrations
, which is an array
of type Registration, or an empty array if no registrations were found. It also includes a
'more
' property which, if present, can be used to retrieve the next paginated set of results
RegistrationQueryOptions
Returns a list of registrations for the given course. Can be filtered to provide a subset of results.
This request is paginated and will only provide a limited amount of resources at a time. If there are more results to be collected, a more token provided with the response which can be passed to get the next page of results. When passing this token, no other filter parameters can be sent as part of the request. The resources will continue to respect the filters passed in by the original request.
ScormClientError if an invalid request was made, or an error encountered
A RegistrationQueryResponse that has a property named registrations
, which is an array
of type Registration, or an empty array if no registrations were found. It also includes a
'more
' property which, if present, can be used to retrieve the next paginated set of results
The course ID for which to return registrations
RegistrationQueryOptions
Returns a list of registrations for the given learner. Can be filtered to provide a subset of results.
This request is paginated and will only provide a limited amount of resources at a time. If there are more results to be collected, a more token provided with the response which can be passed to get the next page of results. When passing this token, no other filter parameters can be sent as part of the request. The resources will continue to respect the filters passed in by the original request.
ScormClientError if an invalid request was made, or an error encountered
A RegistrationQueryResponse that has a property named registrations
, which is an array
of type Registration, or an empty array if no registrations were found. It also includes a
'more
' property which, if present, can be used to retrieve the next paginated set of results
The learner ID for which to return registrations
RegistrationQueryOptions
Creates a course from a package uploaded from your file system. The package will be sent as part of the request and will be stored in SCORM Cloud. An import job ID will be returned, which can be used with getCourseImportStatus to view the status of the import. Courses represent the learning material a learner will progress through. Note: The import job ID is only valid for one week after the course import finishes.
API Method - CreateUploadAndImportCourseJob
ScormClientError if an invalid request was made, or an error encountered
A CourseImportResponse if successfull
The course ID
The path to the file that must be imported to SCORM Cloud
CourseImportOptions
Get back a message indicating that the API is working
ScormClientError if invalid ping response received, or an error was encountered
Options
Checks that the registration exists within SCORM Cloud. No registration data will be returned for this call. If you are looking for information about the registration, try using getRegistration instead.
ScormClientError if an invalid request was made
A boolean true or false
An ID for which registration to check
Options
Updates the title of the course.
ScormClientError if an invalid request was made, or an error encountered, or if the referenced course does not exist
The course ID
The new title to be set
Options
Creates or updates an asset file uploaded from your file system into the course version. The file will be sent as part of the request and will be stored in SCORM Cloud alongside the course. This is a useful way to modify the course structure without needing to reimport the whole course after you've made changes.
If the course structure is being heavily modified, consider creating a new version instead. This can be done by calling importCourse, while passing true for mayCreateNewVersion
API Method - UploadCourseVersionAssetFile
ScormClientError if an invalid request was made, or an error encountered
A types.CourseVersionAssetUploadResponse if successfull
The course ID
The version number
The local path to the file that must be imported to SCORM Cloud
The relative path from the course's base directory on SCORM Cloud, to where the asset file will be uploaded
CourseVersionAssetUploadOptions
Generated using TypeDoc
Usage example:
You will notice that no call has been made to the
authenticate()
method before starting to use the client. When a method is invoked and no valid auth token for the given scope can be found, then the client will attempt to authenticate and fetch a token for that scope. As such, tokens are explicitly associated with a specific scope, and the client will internally manage a set of tokens and their associated scopes.Any future calls for a given scope will use the token associated with it. If no scope is specified (in the
options
for a method), then the default scope (assigned at client instantiation) will be assumed. You are able to manuallyauthenticate()
different scopes, which is simply asking the client to fetch and store a token for a scope, such that it is immediately available in method calls later.Note: the scope can also be a list of space separated scopes, e.g. "write:course read:registration". In such a case the token will be associated with all the specified scopes.