API Modules

5. API Modules #

Note not all RESTFul functions are implemented.

If you encounter an restful API method that is not implemented, please let us know at support@aura-software.com.

5.1. List Of Parameters Available To All Methods #

For the API documentation that follows, for the sake of brevity we will omit in the description of each individual method the generic parameters that can be passed to each method.

These are described in more depth here:

ParameterExampleDescription
formatformat=(json|xml|csv)Specify the format of the response

Note, you must specify ONE OF:

  • api_key
  • realm_guid AND realm_secret_key
  • sc_app_id AND sc_secret_key [DEPRECATED]
ParameterExampleDescription
sc_app_idsc_app_id=[a valid sc_app_id]
sc_secret_keysc_secret_key=[a valid sc_secret_key]
realm_guidrealm_guid=[a valid realm_guid]
realm_secret_keyrealm_secret_key=[a valid realm_secret_key]
api_keyapi_key=[a valid api_key]
accessTokenaccessTokenFor historical reasons this is a synonym of api_key

Parameters that control the data to be returned. #

See specifying the list of fields to be returned for more information.

ParameterExampleDescription
fieldsfields=[field1,…]specifying the list of fields to be returned
api_templateapi_template=(publicpublic_minimum)

5.2. API Key #

The API Key interface allows for the creation of API keys for Bright Server.

5.2.1. Method: create #

Create a new API key.

5.2.1.1. HTTP Model: #

VerbForm
Post(http|https)://BRIGHT_URL/bright/api/v2/api_key?param1=value1&...

5.2.1.2. Parameters #

ParameterExampleNotes
sc_app_id(optional) You must use either sc_app_id and sc_secret_key OR realm_guid and realm_secret_key.
sc_secret_key(optional)
realm_guid(optional) You must use either sc_app_id and sc_secret_key OR realm_guid and realm_secret_key.
realm_secret_key(optional)
user_emailuser_email=jane.doe@me.com(optional). When specifying a user email when generating an API key, this api key will be "bound" to this user and will be unable to access data unrelated from the user. If you do not set user_email, the generated token will have unlimited (administrative) access to the SCORMCloud application or Bright Realm specified.

If you specify an email that is new to the system, an account is automatically created for that user, and the new user is attached as a subscriber class user to the Bright Realm attached to the this SCORM Cloud application.

5.2.1.3. Return Data #

Returns a JSON document of the new record. HTTP Code is set to 201 (item created).

5.2.1.4. Example: #

curl -w "%{http_code}" -d 'sc_app_id=RQIBAXU49I
&sc_secret_key=nCwrTDSy1MzaeyhN0TFfi3uH3huzlu6CNmyHUG5N
&user_email=admin@aura-software.com' https://[BRIGHT URL]/bright/api/v2/api_key/

{
 "access_token":"a440b1ad868bc76716d22b4b827db77e",
 "created_at":"2012-12-18T12:16:29Z",
 "expires_at":null,
 "id":139,
 "course_provider_id":6,
 "token_type":null,
 "updated_at":"2012-12-18T12:16:29Z",
 "user_id":12
}
201

Note that this is a POST request, so you must configure your client appropriately. In the case of curl, this is accomplished with the -d flag.

The ‘-w %{http_code}’ piece allows you to view the returned HTTP code.

5.2.1.5. HTTP Codes #

CodeDescription
201Success; item created
401If you do not specify a valid sc_app_id/sc_secret_key or realm_guid/realm_secret_key, you will receive HTTP error 401 (unauthorized).
500If you specify a user_email that is not valid, you will receive a 500 server error.

5.3. Course #

5.3.1. Determining your :id for create and update #

For courses, Bright maintains a GUID that can be used as the :id field when using create, update, gcreate, or gupdate methods.

If course provider is SCORMCloud, this will be identical to the SCORMCloud course id.

For other course providers, the GUID will be a Bright generated unique ID.

5.3.2. Method: Index #

The index method allows the api user to fetch a course list.

When using the course#index method with an Api key, where the API key is for a particular learner, it is often desireable to return the learner’s registration data on each course selected. This lets the API client avoid having to query the learner’s data for each course returned. You can do this with the include_registrations parameter.

5.3.2.1. HTTP Model: #

VerbForm
GET(http|https)://BRIGHT_URL/bright/api/v2/course[.format]?param1=value1&...

5.3.2.2. Parameters #

All Bright API calls respond the parameters specified in List of Parameters Available To All Methods.

Parameters unique to this method, not included in above:

Control Parameters #

Control parameters are not filters and cannot be used with Using Regular Expression Queries.

ParameterExampleDescription
include_registrationsinclude_registrations=tWhen access is via accessToken, with an associated user, a nested record showing the user’s most recent registration to the course.
Filter Parameters #

Filter parameters restrict the rows to be returned. Any filter parameter can be used with a regular expression, see Using Regular Expression Queries.

ParameterExampleDescription
course_guidcourse_guid=ACourseIDFor a SCORMCloud course, this will match the course ID in scormcloud. See also Finding Your Course ID in SCORMCloud.
titletitle=My%20CourseAn exact match of the course Title. Don’t forget to URI encode your data.
customcustom=SomeCustomTextAn exact match of the course custom. Don’t forget to URI encode your data. Much more useful with ‘custom_re’, as described in Using Regular Expression Queries
idid=[a course GUID]As the Course GUID is the unique identifier for the course, it can be addressed via the id= construct

5.3.2.3. Example #

curl -w "%{http_code}" 'https://[BRIGHT URL]/bright/api/v2/course.json?course_guid=16-4fbd9ea698bce

5.3.2.4. HTTP Codes #

CodeDescription
200Success; items returned
401If you do not specify a valid api_key, sc_app_id/sc_secret_key or realm_guid/realm_secret_key, you will receive HTTP error 401 (unauthorized).
500An illegal request, such as a malformed argument.

5.4. Invitation #

5.4.1. Method: add_learners #

5.4.1.1. HTTP Model #

VerbForm
GET(http|https)://BRIGHT_URL/bright/api/v2/invitation/add_learners[.format]?param1=value1&...

5.4.1.2. parameters #

ParameterExampleNotes
__access method__One of:
api_key=xxxxxxxxxx [an api key created previously]
realm_guid=XXXXXXXXX&realm_secret_key=YYYYYYYYYY [a valid Bright Realm GUID/secret key pair]
see [Access Modes](#access-modes)
api_template
api_template=(public|extended)When set to "extended", the response will include three fields, "record", "messages", and "registration_guids". The "record" is the invitation, and "registration_guids" includes a complex document that can be used to determine if the user in question actualy received their course registrations. This is high useful in the case of invitations used implement license keys. For this type, a user can be added to an invitation without seats available for one or more courses. In this case, the registration_guids document can be used to determine if the user is actually registered to the courses associated with the invitation. Messages contains information from the license key processor relevant for user feedback.
learners
learners=["users1@exampledomain.com","user2@anotherexample.com"]URI encoded array of strings, where each string is an email address. These learners will be added to the invitation, and will receive registrations for the courses associated with the invitation [license data dependent].
name
name=myinvitationyou must specify the invitation by name. Failure to do so, or to specify a valid invitation name, will result in a return code of 404
nodelay
nodelay=trueExternal initialization of registrations will occur synchronously [request will block until they are completed]. The default is asynchronous initialization
skip_external_initialization
skip_external_initialization=trueUseful in tests scenarios. The registrations created won't be externally initialized in the course provider like SCORMCloud
unlearners
unlearners=["users1@exampledomain.com","user2@anotherexample.com"]URI encoded array of strings, where each string is an email address. These learners will be removed from the invitation. Associated registrations will be marked inactive.

5.4.1.3. HTTP Codes #

CodeDescription
200Success; items returned. If show_registration_guids is set to true, the return document is altered. See the documentation for that parameter for more information.
401If you do not pass a valid realm_guid/realm_secret_key, you will receive HTTP 401
404(not found); The value passed in via your name parameter did not match an invitation for this realm
500An illegal request, such as a malformed argument

5.4.1.4. Example #

curl -w "%{http_code}" 'https://[bright-url]/bright/api/v2/invitation/add_learners.json?nodelay=1&api_template=extended&name=xxx&learners=%5B%22admin%40aura-software.com%22%5D&realm_guid=sJtL8PtZG8S0z9bxkjPQ&realm_secret_key=PcQVlfCTIUebps3T268XKzAXvdzFpgc5svkM0uu38Zw'

5.4.1.5. Return Data #

If api_template request parameter isn’t set to extended, the API will respond with the invitation document:

{
  "id": 103,
  "license": true,
  "avoid_duplicate_registrations": false,
  "custom": "{\"license\":true,\"order_id\":10592,\"course_guids\":[\"0215JCHCMscorm12.3cdd5a65-0ec2-44a-c5a1f-37d9283757ce\"],\"license_data\":{\"2051JCHMCscorm1.23cdd56a-5e0c2-44ac-a51f-739d283757ce\":{\"seats_available\":5}},\"initiating_site\":\"localhost\",\"initiating_user\":\"support@aura-software.com\"}",
  "description": null,
  "enabled": true,
  "learners": [
    "support@aura-software.com"
  ],
  "name": "this73807a",
  "no_updates_allowed": false,
  "course_guids": [
    "2c3dd5a65-0ec2-44ac-a51f-37d9283757ce"
  ],
  "registration_guids": [
    "895-XWv_74NgkYTl03_zXIqXwg",
    "895-DY11XFd4ooLiJeGcx7HE3w"
  ],
  "realm_id": 1
}

When api_template is set to extended, the response looks like:

{
  "record": {
    "id": 103,
    "created_at": "2015-11-25T16:40:27.914Z",
    "updated_at": "2015-11-25T16:40:27.914Z",
    "realm_id": 10,
    "name": "this73807a",
    "description": null,
    "enabled": true,
    "custom": "{\"license\":true,\"order_id\":10592,\"course_guids\":[\"2c3dd5a65-0ec2-44ac-a51f-37d9283757ce\"],\"license_data\":{\"2c3dd5a65-0ec2-44ac-a51f-37d9283757ce\":{\"seats_available\":5}},\"initiating_site\":\"localhost\",\"initiating_user\":\"support@aura-software.com\"}",
    "avoid_duplicate_registrations": false,
    "no_updates_allowed": false,
    "invitation_template_id": null,
    "license": true,
    "course_guids": [
      "2c3dd5a65-0ec2-44ac-a51f-37d9283757ce"
    ],
    "learners": [
      "support@aura-software.com"
    ]
  },
  "registration_guids": {
    "support@aura-software.com": {
      "2c3dd5a65-0ec2-44ac-a51f-37d9283757ce": {
        "title": "My Course",
        "registration_guid": "895-XWv_74NgkYTl03_zXIqXwg"
      }
    }
  },
  "messages": [
    "Success!  Found and reused existing registration (895-XWv_74NgkYTl03_zXIqXwg) for support@aura-software.com on 'My Course' as part of license 'this73807a'."
  ]
}

5.5. Realm User #

For learners, its generally not necessary to prepopulate realm users as creating a registration implicitly creates the user.

It is possible to create them via the API and also manipulate their custom field as well.

5.5.1. Method: index #

5.5.1.1. HTTP Model #

VerbForm
GET(http|https)://BRIGHT_URL/bright/api/v2/realm_user[.format]?param1=value1&...

5.5.1.2. parameters #

ParameterExampleNotes
__access method__One of:
api_key=xxxxxxxxxx [an api key created previously]
realm_guid=XXXXXXXXX&realm_secret_key=YYYYYYYYYY [a valid Bright Realm GUID/secret key pair]
see [Access Modes](#access-modes)
email
email=jane.doe@me.comfilter results to just this email address.

5.5.1.3. HTTP Codes #

CodeDescription
200Success; items returned
401If you do not specify a valid api_key, sc_app_id/sc_secret_key or realm_guid/realm_secret_key, you will receive HTTP 401
500An illegal request, such as a malformed argument

5.5.1.4. Example #

5.5.1.5. Return Data #

5.5.2. Method: create #

Creates a new realm user. You must use a realm guid and secret key (or api key creating bound to a realm key) to create a realm user.

5.5.2.1. Parameters #

ParameterExampleNotes
__access method__api_key=[an api key created previously]see Access Modes. You cannot use a SCORMCloud app-id/secret key or user bound api key to create a realm user.
emailemail=bret@aura-software.comemail address of the user (required)
realm_role_idrealm_role_id=1Define the realm role. Not required, defaults to '1' (learner).
customcustom='{this:that}'Define a custom field for this user. Custom fields are freeform metadata available to be defined for the user.

5.5.2.2. HTTP Codes #

CodeDescription
201Success; item created
302Item already exists, not modified.
500If you specify a user_email that is not valid, or a valid course_guid, you will receive a 500 server error.

5.5.2.3. Example #

curl -w "%{http_code}" 
'https://[BRIGHT URL]/bright/api/v2/realm_user/gcreate.xml?
api_key=2a84a6ddb229c13bc945874b69fab8ba&
email=bretx@aura-software.com&
custom=foo'
<?xml version="1.0" encoding="UTF-8"?>
<realm-user>
  <created-at type="datetime">2013-07-03T05:26:21Z</created-at>
  <custom>foo</custom>
  <id type="integer">1743</id>
  <realm-id type="integer">4</realm-id>
  <realm-role-id type="integer">1</realm-role-id>
  <updated-at type="datetime">2013-07-03T05:26:21Z</updated-at>
  <user-id type="integer">1686</user-id>
</realm-user>
201

5.5.3. Method: update (gupdate) #

Update a realm user. You must use a realm guid and secret key (or api key creating bound to a realm key) to update a realm user.

5.5.3.1. Parameters #

ParameterExampleNotes
__access method__api_key=[an api key created previously]see Access Modes. You cannot use a SCORMCloud app-id/secret key or user bound api key to create a realm user.
emailemail=bret@aura-software.comemail address of the user (required)
customcustom='{this:that}'Define a custom field for this user. Custom fields are freeform metadata available to be defined for the user.

5.5.3.2. HTTP Codes #

CodeDescription
200Success; item created
404Realm user cannot be found..
500If you specify a user_email that is not valid, or supply unexpected parameters, you will receive a 500 server error.

5.5.3.3. Example #

curl -w "%{http_code}" 
'https://[BRIGHT URL]/bright/api/v2/realm_user/gupdate.xml?
api_key=2a84a6ddb229c13bc945874b69fab8ba&
email=bretx@aura-software.com&
custom=foox'
200

5.6. Registration #

5.6.1. Determining your :id for create and update #

For registrations, Bright maintains a GUID that can be used as the :id field when using create, update, gcreate, or gupdate methods.

If course provider is SCORMCloud, this will be identical to the SCORMCloud registration id.

For other course providers, the GUID will be a Bright generated unique ID.

5.6.2. Format of return data #

Field NameExample DataDescription
attempts12This is the # of attempts of the course, as recorded in SCORMCloud.
complete"complete"This is the SCORM 'completion' status as recorded in SCORMCloud.
course_result"\ncompletefailed950"The course_result is populated by SCORMCloud and is an XML document that shows the SCORM data collected for the registration. For the format of the course result, see https://cloud.scorm.com/doc/web-services/api.html#rustici.registration.getRegistrationResult where resultsformat is "course".
crawl_error_msgIf there is an error crawling this registration, the error message is listed here.
crawl_status"success"Last crawl status for the registration. Used internally in Bright.
crawl_type"course"Shows the value of "resultsformat" that we used when crawling the registration result. See also https://cloud.scorm.com/doc/web-services/api.html#rustici.registration.getRegistrationResult
created_at"2012-12-21T08:46:36Z"The timestamp for the record when created in Bright. This is not the time the record was created in SCORMCloud.
custom{my_custom_data: 1}Any user defined custom JSON data. This data can be used to build custom functionality into your Bright Embedder.
full_resultnullIf your crawler is running in 'full' mode, (see type), the full results document from https://cloud.scorm.com/doc/web-services/api.html#rustici.registration.getRegistrationResult is available here.
id5426The Bright internal ID for this registration.
last_crawled_at"2012-12-26T14:27:20Z"Datetime the record was last crawled.
launched_at"2012-12-26T14:27:00Z"When this registration is launched from Bright, we maintain a local timestamp of the course launch here. This timestamp can be used via the Bright API to force a recrawl of the registration (using the refresh_if_launched parameter.) See the Bright API document for more information.
learner_id"bret@aura-software.com"Email address of the person to whom this registration belongs.
number_of_crawl_errors0If there is crawl errors, this counter is incremented.
provider_completed_atnullThis is the completed_at field as record in SCORMCloud. SCORMCloud will set this field when it marks the course completed.
course_guid"1-50a38b0d9b2bf_0102b60a8-3bc5-4840-8c90-d1fd01a630c3"The SCORMCloud Course ID.
provider_created_atnullThe timestamp recorded in SCORMCloud as to when the registration was completed. Typically you would use this when displaying data to the user instead of at, which is internal to Bright.
deletednullWill be set to a 1 if the registration has been deleted in SCORMCloud.
provider_errcodenullIf we receive an error interacting with SCORMCloud for this registration, the error code will be recorded here.
provider_error_messagenullError message received from SCORMCloud when attempting to access this registration.
provider_accessed_atnullThe timestamp recorded in SCORMCloud recording the last time the course was accessed.
registration_guid"1-50a38b0d9b2bf_0102b60a8-3bc5-4840-8c90-d1fd01a630c3-65a9ae1bd2f690a3bc789d6a9299b51e"The SCORMCloud registration ID.
score0.0This is the score for the registration recorded in SCORMCloud.
scorm_cloud_app_id10An internal Bright variable corresponding to this SCORMCloud application.
scorm_cloud_course_id525An internal Bright variable corresponding to this SCORMCloud course.
success"failed"The value of the registration success field recorded in SCORMCloud.
totaltime95.0The value of the totaltime field recorded in SCORMCloud.
updated_at"2012-12-26T14:27:20Z"The last time this record was updated in Bright.

5.6.3. Method: index #

The index method allows the api user to query registrations.

5.6.3.1. HTTP Model #

VerbForm
GET(http|https)://BRIGHT_URL/bright/api/v2/registration[.format]?param1=value1&...

5.6.3.2. parameters #

ParameterExampleNotes
__access method__One of:
api_key=xxxxxxxxxx [an api key created previously]
sc_app_id=XXXXXXXXX&sc_secret_key=YYYYYYYYYYY [a valid SCORMCloud app ID/secret key pair]
realm_guid=XXXXXXXXX&realm_secret_key=YYYYYYYYYY [a valid Bright Realm GUID/secret key pair]
see [Access Modes](#access-modes)
last_only
last_only=twhen included in the parameter string, we will return a single registration record, that being the last one created. Useful in cases where multiple registrations are found and only the most recent one should be returned.
course_guid
course_guid=[a scorm cloud course id]filter results to just this SCORMCloud course ID
learner_id
learner_id=jane.doe@me.comfilter results to just this email address.
refresh_if_launched
refresh_if_launched=tif the last launch date of this registration is newer than the last crawl date, this will force the record to recrawl prior to returning a result.
crawl
crawl=tforces the registration to recrawl

5.6.3.3. HTTP Codes #

CodeDescription
200Success; items returned
401If you do not specify a valid api_key, sc_app_id/sc_secret_key or realm_guid/realm_secret_key, you will receive HTTP
500An illegal request, such as a malformed argument

5.6.3.4. Example #

curl -w "%{http_code}" 'https://[BRIGHT URL]/bright/api/v2/registration.json?
api_key=2a84a6ddb229c13bc945874b69fab8ba&
learner_id=bret@aura-software.com&
course_guid=16-4fbd9ea698bce

5.6.3.5. Return Data #

5.6.4. Method: create #

Creates a new registration. Can be used in a single call that can be used to return an existing registration if one exists, or create a new one if it does not.

5.6.4.1. Parameters #

ParameterExampleNotes
__access method__api_key=[an api key created previously]see Access Modes
sc_app_idsc_app_id=XXXXYYYYZZZ [a valid app ID]SCORMCloud application ID (required)
sc_secret_keysc_secret_key=XXXXYYYYZZZ [a valid app secret key]SCORMCloud application secret key (required)
course_guidcourse_guid=16-4fbd9ea698bceSCORMCloud course ID (required)
learner_idlearner_id=bret@aura-software.comemail address of user (required)
dont_duplicatedont_duplicate=tcheck for an existing registration for this course and user, just return that if found. (optional)
check_scorm_cloudcheck_scorm_cloud=tcheck the SCORMCloud API for existing registrations as well as the local Bright database (optional). This can be useful in test scenarios where Bright SCORMCloud crawler is not functioning, and it is desirable not to create a lot of duplicate registrations. Typically not used in production.
fnamefname=bretCan be used to set the first name in the SCORMCloud registration.
lnamelname=weinraubCan be used to set the last name in the SCORMCloud registration.

5.6.4.2. HTTP Codes #

CodeDescription
201Success; item created
401If you do not specify a valid sc_app_id/sc_secret_key or realm_guid/realm_secret_key, you will receive HTTP error 401 (unauthorized).
403In some cases an additional error message is returned (see below).
404You provided a course_guid that can't be found for this access method, or none at all. If you are using the create (and not gcreate alias), make sure you are posting the data correctly.
500If you specify a user_email that is not valid, or a valid course_guid, you will receive a 500 server error.

In case of errors accessing the SCORMCloud API, a message including the error is returned (error code 403):

{
"error_code":"4",
"error_message":"The maximum number of registrations has been reached.",
"error_url":"https://cloud.scorm.com/api?email=..."
}

Please note if you are using JSONP, since there are limited facillities to capture errors via JSONP, we will return error code 200, with the error block above. Otherwise you might find it difficult to correctly handle this error.

5.6.4.3. Example #

For a successful request returned will be an XML or JSON document of the SCORMCloud registration. Note this example is using the gcreate alias (using an HTTP get).


curl -w "%{http_code}" 
'https://[BRIGHT URL]/bright/api/v2/registration/gcreate.json?
api_key=2a84a6ddb229c13bc945874b69fab8ba&
learner_id=bret@aura-software.com&
course_guid=16-4fbd9ea698bce&
sc_app_id=XXXYYYYZZZ&
sc_secret_key=nCwrTDSy1MzaeyhN0TFfi3uH3huzlu6CNmyHUG5N&
dont_duplicate=t'
{
 "attempts"=>2,
 "complete"=>"complete",
 "course_result"=>'<?xml version="1.0" encoding=...?> <rsp>...</rsp>',
 "crawl_error_msg"=>nil,
 "crawl_status"=>"success",
 "crawl_type"=>"course",
 "created_at"=>"2012-12-21T08:39:12Z",
 "full_result"=>nil,
 "id"=>5336,
 "last_crawled_at"=>"2012-12-12T16:33:33Z",
 "learner_id"=>"bret@aura-software.com",
 "number_of_crawl_errors"=>0,
 "provider_completed_at"=>nil,
 "course_guid"=>"20-NSFoundationPostTrainingQuiz",
 "provider_created_at"=>"2012-12-12T16:32:04Z",
 "deleted"=>nil,
 "provider_errcode"=>nil,
 "provider_error_message"=>nil,
 "provider_accessed_at"=>nil,
 "registration_guid"=>"79c0dd35-139-048258-16e-9a1561b0a85d",
 "score"=>99.2,
 "course_provider_id"=>10,
 "course_id"=>509,
 "success"=>"succeeded",
 "totaltime"=>100.0,
 "updated_at"=>"2012-12-21T08:39:12Z"
}

5.6.5. Method: launch_url #

The launch_url method is used to a get a unique, transient URL for course launch in direct response to a course launch event. Note, these cannot be cached, as they will expire.

5.6.5.1. HTTP Model #

VerbForm
GET(http|https)://BRIGHT_URL/bright/api/v2/registration/[registration_guid]/launch_url.[format=xml|json|csv]?params...

5.6.5.2. parameters #

ParameterExampleNotes
__access method__One of:
api_key=xxxxxxxxxx [an api key created previously]
sc_app_id=XXXXXXXXX&sc_secret_key=YYYYYYYYYYY [a valid SCORMCloud app ID/secret key pair]
realm_guid=XXXXXXXXX&realm_secret_key=YYYYYYYYYY [a valid Bright Realm GUID/secret key pair]
see [Access Modes](#access-modes)
launching
launching=?launching=1Deprecated. Historically, caused the creation of a launchHistory record in Bright; which is now deprecated
review
review=?review=1Specifies the course will be launched in review mode and progress will not be tracked
redirect_url
redirect_url=?redirect_url=[uri encodeed URL]When the user exits the course, the browser window will redirect to this URL
tags
tags=?tags=[uri encoded list of course tags]Feature included for backward compatibility with the SCORMCloud plugin for WordPress. When a course was launched from a page/post, the course was auto-tagged with the page category.

5.6.5.3. HTTP Codes #

CodeDescription
200Success; items returned
401If you do not specify a valid api_key, sc_app_id/sc_secret_key or realm_guid/realm_secret_key, you will receive HTTP
500An illegal request, such as a malformed argument

5.6.5.4. Example #

5.6.5.5. Return Data #

5.7. StoredQuery #

5.7.1. Method: initialize #

Initialize is generally not necessary, but can be used in fresh installs of Bright Server to initialize the stored queries with a query_scope of ‘bright’.

5.7.1.1. HTTP Model #

VerbForm
GET(http|https)://BRIGHT_URL/bright/api/v2/initialize[.format]

5.7.1.2. parameters #

ParameterExampleNotes
__access method__One of:
api_key=xxxxxxxxxx [an api key created previously]
sc_app_id=XXXXXXXXX&sc_secret_key=YYYYYYYYYYY [a valid SCORMCloud app ID/secret key pair]
realm_guid=XXXXXXXXX&realm_secret_key=YYYYYYYYYY [a valid Bright Realm GUID/secret key pair]
see [Access Modes](#access-modes)

5.7.1.3. HTTP Codes #

CodeDescription
200Success; items returned
401If you do not specify a valid api_key, sc_app_id/sc_secret_key or realm_guid/realm_secret_key, you will receive HTTP 401

5.7.1.4. Example #

5.7.1.5. Return Data #

5.7.2. Method: run #

5.7.2.1. HTTP Model #

VerbForm
GET(http|https)://BRIGHT_URL/bright/api/v2/run[.format]?name=[query-name]&...

5.7.2.2. parameters #

ParameterExampleNotes
__access method__One of:
api_key=xxxxxxxxxx [an api key created previously]
sc_app_id=XXXXXXXXX&sc_secret_key=YYYYYYYYYYY [a valid SCORMCloud app ID/secret key pair]
realm_guid=XXXXXXXXX&realm_secret_key=YYYYYYYYYY [a valid Bright Realm GUID/secret key pair]
see [Access Modes](#access-modes)
name
name=myStoredQuerythis is the query to run. Note for "builtin" queries, these are available for all realms and you will need to set query_scope=bright
query_scope
query_scope=brightwhen set to "bright", the indication is this stored query is generic, not custom to your course provider or realm
format
format=csv|json|xmldefines the format the data should be returned as. Will set the content type of the response

5.7.2.3. HTTP Codes #

CodeDescription
200Success; items returned
401If you do not specify a valid api_key, sc_app_id/sc_secret_key or realm_guid/realm_secret_key, you will receive HTTP 401
404A typical result when no stored query is found for your name= paramter
500An illegal request, such as a malformed argument

5.7.2.4. Example #

5.7.2.5. Return Data #

5.8. Template #

5.8.1. Method: index #

5.8.1.1. HTTP Model #

VerbForm
GET(http|https)://BRIGHT_URL/bright/api/v2/template[.format]?param1=value1&...

5.8.1.2. parameters #

ParameterExampleNotes
__access method__One of:
api_key=xxxxxxxxxx [an api key created previously]
realm_guid=XXXXXXXXX&realm_secret_key=YYYYYYYYYY [a valid Bright Realm GUID/secret key pair]
see [Access Modes](#access-modes)
name
name=My Templatefilter results to just this name.
markup
markup=handlebarsfilter results to just this markup.
mimetype
mimetype=text/htmlfilter results to just this mimetype.

5.8.1.3. HTTP Codes #

CodeDescription
200Success; items returned
401If you do not specify a valid api_key, sc_app_id/sc_secret_key or realm_guid/realm_secret_key, you will receive HTTP 401
500An illegal request, such as a malformed argument

5.8.1.4. Example #

5.8.1.5. Return Data #

5.8.2. Method: create #

5.8.2.1. Parameters #

5.8.2.2. HTTP Codes #

5.8.2.3. Example #

5.8.3. Method: update (gupdate) #

5.8.3.1. Parameters #

5.8.3.2. HTTP Codes #

5.8.3.3. Example #