Introduction
The SCORM Cloud API Libraries have been created to assist in the integration of SCORM Cloud functionality into other applications. While the libraries do not all provide exhaustive coverage for all SCORM Cloud service calls, they do provide wrappers for the basic service calls that most integrations require.
Some of the libraries provide more functionality than others; for instance, the Java library covers almost all of the available service calls since that is the library we use in the SCORM Cloud web app. This guide is meant to describe that calls that are shared by all of the service libraries.
If you are looking for a description of the SCORM Cloud API, that can be found here in the SCORM Cloud Cloud Integration and API Documentation
Downloads
Services
The services and functions described below are available in all of the libraries. This is not, however, an exhaustive list of the services and functions available in every library. Most of the services contain more functions available to you to use which can be found by looking at the source code.
Debug Service
Class Name: DebugService
CloudPing()
Return Value: Boolean - true if successful
Checks for a successful connection to the SCORM Cloud server.
CloudAuthPing()
Return Value: Boolean - true if valid
Checks for a valid authenticated connection to the SCORM Cloud server.
Upload Service
Class Name: UploadService
GetUploadToken()
Return Value: UploadToken object
Receives an authentication token to use when uploading files to the SCORM Cloud server.
GetUploadUrl(String redirectUrl)
| Arguments: |
redirectUrl - String value that the SCORM Cloud should redirect user's to after upload.
|
Return Value: String - url value
Retrieves an authentication token and then retrieves the URl where a file can be uploaded to on the server. This is meant to serve as the "action" argument in a web form so that a file upload will be directed to the SCORM Cloud. The redirectUrl is necessary so that the upload page can redirect the user back to that page after the upload. Note that the redirect Url will be updated with a location query string argument. This can be used to tell the SCORM Cloud to import the uploaded file.
DeleteFile(String filepath)
| Arguments: |
filepath - String value of the path to the SCORM cloud location of the file (typically returned from a file upload)
|
Deletes a file on the SCORM Cloud server that has been uploaded. Note that this does not delete SCORM Cloud courses or imported course files.
Course Service
Class Name: CourseService
ImportUploadedCourse(String courseId, String pathToCourse)
| Arguments: |
courseId - Unique string value of the courseId to assign to the course on the SCORM Cloud
pathToCourse - String value of the location of the course on the SCORM Cloud
|
Return Value: ImportResult object
Imports a previously uploaded course into the SCORM Cloud so it can be used for registrations. Note that the pathToCourse value is typically the one passed back to the redirectUrl as 'location' from the Upload Service. The courseId assigned is of your choosing.
GetPreviewUrl(String courseId, String redirectonExitUrl, String cssUrl)
| Arguments: |
courseId - String value of the courseId to preview
redirectonExitUrl - String value of the url to redirect to upon course exit
cssUrl - String value of the url of a custom stylesheet for the course player rendering
|
Return Value: String - the preview launch Url
Retrieves the URL of a preview of the course identified by the courseId passed in. A preview is an untracked playing of the course and does not require a registration.
GetPropertyEditorUrl(String courseId, String stylesheetUrl, String notificationFrameUrl)
| Arguments: |
courseId - String value of the courseId to view properties for
stylesheetUrl - String value of the url of a custom stylesheet for the properties editor
notificationFrameUrl - Tells the property editor to render a sub-iframe with the provided url as the src. This can be used to simulate an "onload" by using a notificationFrameUrl that's the same domain as the host system and calling parent.parent.method().
|
Return Value: String - the properties editor src Url
Retrieves the URL of a properties editor for the course identified by the courseId passed in. This is most often assigned to the 'src' attribute of an iframe on a page, but it can also be the location of a page. The stylesheetUrl and notificationFrameUrl are most often passed null values.
DeleteCourse(String courseId)
| Arguments: |
courseId - String value of the courseId to preview
|
Deletes the course identified by the courseId passed in.
GetAttributes(string courseId, int versionId)
| Arguments: |
courseId - String value of the courseId to preview
versionId - Integer value of the version to get the attributes of. (optional argument)
|
Return Value: Dictionary object mapping attributes to values
Retrieves the attributes of a course that can be set. The returned dictionary is a hash of the string attribute name as key and the string attribute value as the hash value. The versionId can be null.
UpdateAttributes(string courseId, int versionId, Dictionary attributePairs)
| Arguments: |
courseId - String value of the courseId to preview
versionId - Integer value of the version to set the attributes of.
attributePairs - Dictionary object mapping attributes to values of the attributes you wish to update
|
Return Value: Dictionary object mapping attributes to values of the modified attributes
Updates the sent attributes of a course. The returned dictionary is a hash of the string attribute name as key and the string attribute value as the hash value of the attributes that have been changed by the call.
GetCourseList(string courseIdFilterRegex)
| Arguments: |
courseIdFilterRegex - String value of a regular expression search string (optional)
|
Return Value: A collection of CourseData objects
Retrieves a list of CourseData objects describing the courses that match the filter string passed in. If no filter is passed in, then all courses in for the AppId will be returned.
Registration Service
Class Name: RegistrationService
CreateRegistration(String registrationId, String courseId, String learnerId, String learnerFirstName, String learnerLastName)
| Arguments: |
registrationId - Unique string value you provide as a registration identifier
courseId - String value of the course identifier for the course to register
learnerId - String value of the learner identifier for the registration
learnerFirstName - String value of learner's first name
learnerLastName - String value of learner's last name
email - String value of learner's email (optional)
|
Creates a new registration for the learner to take the identified course. The provided registrationId is how to refer to this registration in future calls. If the email is provided, the registration will be linked to a SCORM Cloud user with the same email.
DeleteRegistration(string registrationId, bool deleteLatestInstanceOnly)
| Arguments: |
registrationId - String value identifier of the registration to delete
deleteLatestInstanceOnly - boolean value of whether to only delete latest (usually defaults to false)
|
Deletes the specified registration.
ResetRegistration(string registrationId)
| Arguments: |
registrationId - String value identifier of the registration to reset
|
Resets the tracked data (results, time spent, etc.) of the specified registration.
GetRegistrationList(String regIdFilterRegex, String courseIdFilterRegex)
| Arguments: |
regIdFilterRegex - String regular expression value filtering against registration Id's (optional)
courseIdFilterRegex - String regular expression value filtering against course Id's (optional)
|
Return Value: A collection of RegistrationData objects
Retrieves a list of RegistrationData objects, each representing a registration fetched form the SCORM Cloud. The optional arguments are to filter the results when querying from the SCORM Cloud. Note that a registrationId and a courseId are acceptable values to use for the arguments.
GetRegistrationResult(string registrationId, RegistrationResultsFormat resultsFormat, DataFormat dataFormat)
| Arguments: |
registrationId - String value identifier of the registration to get results for
resultsFormat - RegistrationResultsFormat value indicating the degree results detail desired
dataFormat - DataFormat value indicating the format of the returned data (xml, json)
|
Return Value: String value of the resulting results.
Retrieves the results of the specified registration. The returned string is either in xml or json format, depending on the dataFormat argument. The default is XML.
GetLaunchUrl(String registrationId, String redirectOnExitUrl, String cssUrl, String debugLogPointerUrl)
| Arguments: |
registrationId - String value identifier of the registration to launch
redirectonExitUrl - String value of the url to redirect to upon course exit
cssUrl - String value of the url of a custom stylesheet for the course player rendering (optional)
debugLogPointerUrl - String value Url that the server will postback a "pointer" url regarding a saved debug log that resides on s3 (optional)
|
Return Value: String - the launch Url
Retrieves the URL of a launch of the course identified by the registrationId passed in. If a debugLogPointerUrl is provided, the SCORM Cloud will send to that URL a location of a debug log for the launched session.
ResetGlobalObjectives(String registrationId, boolean deleteLatestInstanceOnly)
| Arguments: |
registrationId - String value identifier of the registration associated with the globals to reset
deleteLatestInstanceOnly - Boolean value of whether to delete the latest version's globals only or all versions'
|
Resets the global objectives associated with the specified registration.
Invitation Service
Class Name: InvitationService
CreateInvitation(String courseId, boolean publicInvitation, boolean send,
String addresses, String emailSubject, String emailBody, String creatingUserEmail, Integer registrationCap,
String postbackUrl, String authType, String urlName, String urlPass, String resultsFormat,
boolean async)
| Arguments: |
courseId - String value of the course identifier for the course to invite users to
publicInvitation - Boolean value of whether the course is public or private; public is true
send - Boolean value of whether to send (private invitations) to addresses provided
addresses - String value of comma-delimited list of emails to send invitations to
emailSubject - String value of the email subject to send to recipients
emailBody - String value of email body to sent to recipients
creatingUserEmail - String value of SCORM Cloud users creating invitation
registrationCap - Integer value of limit of public invitation registrations to allow
postbackUrl - String value of registration results postback destination for registrations created
authType - String value of the auth type for the postback URL
urlName - String value of the auth username for the postback
urlPass - String value of the auth password for the postback
resultsFormat - String value of the registration results format for the postback
async - Boolean value of whether to send private invitations asynchronously; true is asynchronous
|
Return Value: The invitation Id of the new invitation.
Creates a new invitation to provide avenues for learners to take courses. Public invitations produce a public URL that anyone can use to access the course and registrations are created for users at launch time. Registrations for private invitation recipients are created at invitation creation time and are optionally sent to the recipients. For sending private invitations, html is accepted and certain tags are available for inserting into the email body or subject at send time. Those tags are described
here. The postback functionality available with an invitation is the same as for creating registrations; each registration created from an invitation will be created with the associated postback information from the invitation. More information about the postback functionality can be found
here.
GetInvitationStatus(string invitationId)
| Arguments: |
invitationId - String value identifier of the invitation requesting the status of
|
Return Value: A string value indicating the status of the job.
Checks the status of the asynchronous create invitation job associated with the given invitation Id. This only applies to private invitations whose recipients' registrations were created and optionally sent asynchronously.
GetInvitationList(string filter, string coursefilter)
| Arguments: |
filter - String regular expression value filtering against invitation Id
coursefilter - String regular expression value filtering against course Id
|
Return Value: A collection of InvitationInfo objects. (In PHP/Python, returns the raw XML response.)
Retrieves a list of InvitationInfo objects, each representing an invitation fetched form the SCORM Cloud. The optional arguments are to filter the results when querying from the SCORM Cloud. Note that an invitationId and a courseId are acceptable values to use for the arguments.
GetInvitationInfo(string invitationId, boolean includeRegistrationSummary)
| Arguments: |
invitationId - String value identifier of the invitation requesting the information of
includeRegistrationSummary - Boolean value indicating whether to also return the registration summary of any associated learner registrations
|
Return Value: An InvitationInfo object. (In PHP/Python, returns the raw XML response.)
Retrieves an InvitationInfo object. If there are associated user invitations created for the invitation, then these will also be returned, optionally with the associated registration summary.
ChangeStatus(string invitationId, boolean enable, boolean open)
| Arguments: |
invitationId - String value identifier of the invitation updating the status of
enable - Boolean value indicating whether invitation registrations can be launched; true is launchable
open - Boolean value indicating whether new invitation registrations can be launched; true means new registrations can be created - applies to public invitations only
|
Updates the AllowLaunch and AllowNewRegistrations fields of an invitation.
Reporting Service
Class Name: ReportingService
GetReportageAuth(ReportageNavPermissionType navPermission, boolean isAdmin)
| Arguments: |
navPermission - ReportageNavPermissionType value specifying the navigation rights of the authentication (nonav,downonly,freenav)
isAdmin - Boolean value of whether authentication is for an administrator
|
Return Value: String Authentication token value
Retrieves an authentication token to use when accessing the Reportage system for SCORM Cloud reporting.
GetReportUrl(String reportageAuth, String reportUrl)
| Arguments: |
reportageAuth - String token value returned by the GetReportateAuth call
reportUrl - String URL value of the reportage report being requested
|
Return Value: String URL value
Retrieves a URL to access the a Reportage page or widget. The reportUrl value is highly customizable, depending on the desired output or report. More information can be found on the
Using Reportage documentation
Contribute Code
We welcome code contributions to help improve the libraries available. This could include changes to fix or improve existing code or add-ons to make integrations easier. Github has documentation for how to use git and for how to upload new code to the projects.
If you have created a new library based on a language not represented here and you are willing to share that library, we are more than happy to host and manage the code for that project, as well.
Please feel free to contact us at support@scorm.com if you have any questions or enhancement ideas.