API Configuration

For situations in which a static configuration file determining behavior application-wide isn't the best approach, most of Engine's settings can be configured through the REST API. This has two simultaneous benefits:

  1. Your application can dynamically configure Engine's behavior on the fly
  2. Those settings can be scoped to only affect certain tenants, courses, or registrations

Here's an example: One of the Engine's most commonly configured settings is PlayerScoLaunchType. This setting is used to determine whether Engine should, on course launch, open the course content in a new window or open the content within an iframe on the player page. The appropriate value for this setting is highly dependent on the context in which Engine's player is being launched, and as such can be different for every customer.

If an Engine user has one client (whose tenant name is "client-4623") that insists that their courses should launch in a new window, then the behavior for that single tenant can be addressed without changing the behavior for every other client. To do this, the you would just need to make a POST request to Engine's API.

Here are the URLs used to specify setting values at various levels:

  • system: /appManagement/configuration (with no tenant specified in the EngineTenantName header)
  • tenant: /appManagement/configuration (with the tenant specified in the EngineTenantName header)
  • course: /courses/{course ID}/configuration
  • registration: /registrations/{registration ID}/configuration

In each case, the body of the POST request is a JSON object like the following:

{
    "settings": [
        { "settingId": "PlayerScoLaunchType", "value": "NEW_WINDOW" },
        { "settingId": "PlayerLaunchType", "value": "FRAMESET" }
    ]
}

Since the settings parameter is an array, you could specify multiple configuration values in this same call if desired.

Settings with JSON values

Some settings in Engine require that you pass in a value that is JSON. Since the schema above requires the value to be a string, this means you would have to 'stringify' the JSON in order to send it as part of this request.

For example, with the ContentLangToUrl course configuration setting, where you are specifying subtitle files for video content, you would be required to submit some JSON like this:

[
    {
        "label": "English",
        "srclang":"en",
        "src": "/supportFiles/en.vtt",
        "default": true,
        "kind": "subtitles"
    },
    {
        "label": "French",
        "srclang": "fr",
        "src": "/supportFiles/fr.vtt",
        "default": false,
        "kind": "subtitles"
    }
]

However, the actual confguration API call would look something like this:

{
    "settings": [
        {
            "settingId": "ContentLangToUrl",
            "value": "[{ \"label\": \"English\", \"srclang\":\"en\", \"src\": \"/supportFiles/en.vtt\", \"default\": true, \"kind\": \"subtitles\"},{ \"label\": \"French\", \"srclang\": \"fr\", \"src\": \"/supportFiles/fr.vtt\", \"default\": false, \"kind\": \"subtitles\"}]"
        }
    ]
}

The output above has the newlines and extra spacing removed for readability, but you could pass the direct stringification of the JSON if desired.

results matching ""

    No results matching ""