IMS Final Release

A REST API for Tool Settings in multiple formats

Final Version 1.0
Date Issued: 10 September 2015
Latest version: http://www.imsglobal.org/lti

Abstract

This specification defines a REST API for reading and updating Tool Settings.

Table of Contents

1. Introduction

This specification defines a REST API for reading and updating Tool Settings. Following common conventions, the API uses a different HTTP verb for each type of operation: GET for read and PUT for update.

In the IMS LTI standard, Tool Settings may be attached to certain resources within the Tool Consumer system. In particular, settings may be attached to LtiLink, ToolProxyBinding, and ToolProxy resources. Each of these resource types is a kind of ToolSettingsContainer. Through the REST API described in this document, a client may request settings from one particular container. By including the bubble query parameter, the client may request that the response contain settings from "higher-level" containers as well. For example, a client may request settings from an LtiLink resource and with bubble=all, the client will also receive settings from the learning context that contains the link plus settings defined at the system level (within the ToolProxy).

2. Representations

Tool Settings accessed through this REST API are represented by JSON documents in the following formats:
application/vnd.ims.lti.v2.toolsettings+json
application/vnd.ims.lti.v2.toolsettings.simple+json

When requesting settings via an HTTP GET request, the client specifies the desired format with the Accept header. When submitting settings via an HTTP PUT request, the client declares the format of the supplied JSON document with the Content-Type header.

3. URL Templates

Implementations of this REST API must offer an endpoint for accessing Tool Settings from each of three different types of containers: LtiLink, ToolProxyBinding, and ToolProxy. This specification does not mandate any particular URL templates for these endpoints, but the following templates are recommended:
{+base}/lti/links/{link_id}/custom 
{+base}/lis/{context_type}/{context_id}/bindings/{vendor_code}/{product_code}/custom 
{+base}/lti/ToolProxy/{tool_proxy_guid}/custom

where base is the base URL, and the path parameters are defined as follows:

link_id
The local identifier for an LtiLink.
context_type
The simple name for the context type, e.g. Group, CourseSection, CourseTemplate, etc.
context_id
The local identifier for the context
vendor_code
The vendor code for a ToolProxy that is bound to the learning context
product_code
The product code for a ToolProxy that is bound to the learning context
tool_proxy_guid
The globally unique identifier for a ToolProxy

For example, these templates might yield something like the following URL values:

https://lms.example.com/lti/links/402854/custom 
https://lms.example.com/lis/CourseSection/9283/bindings/acme.com/assessment-tool/custom 
https://lms.example.com/lti/ToolProxy/e6b6f6cc253a4d23ad57defbbd2a8e37/custom 

The first URL provides access to tool settings scoped to a particular LtiLink. The second URL provides access to tool settings scoped to a particular learning context. The third URL provides access to system wide tool settings.

A Tool Consumer that implements this REST API must declare its URL templates within the Tool Consumer Profile. The templates are for information purposes and there is no contract that the Tool Consumer must support all possible endpoints that can be derived from each template. The The recommended practice is to have the Tool arrange for the Tool Consumer to send fully formed endpoints in the launch requests by specifying certain variables as launch parameters. The LTI standard defines the following variables:

LtiLink.custom.url
The endpoint URL for accessing link-level tool settings
ToolProxyBinding.custom.url
The endpoint URL for accessing context-level tool settings
ToolProxy.custom.url
The endpoint URL for accessing system-wide tool settings

4. Service Methods

4.1 GET

To get a collection of Tool Settings, the client submits an HTTP GET request to the appropriate endpoint in accordance with the following rules:

 

ParameterDescription
bubbleThis query parameter specifies that the response should contain Tool Settings not only from the scope targeted by the endpoint URL, but also all higher-level scopes. For example, if the request is submitted to an LtiLink resource and the bubble parameter is present, then the response would include link-level, context-level and system-level settings.

There are two possible values for the bubble parameter: all and distinct. When bubble=all, the server will return all tool settings from all the relevant scopes. This option cannot be used with the application/vnd.ims.lti.v2.toolsettings.simple+json media type. When bubble=distinct, the server will return tool settings from all the relevant scopes, but duplicates will be removed. That is to say, if a property with the same name appears in more than one scope, then the response will contain the property from the lowest-level scope only; the corresponding property from higher-level scopes will be omitted from the response.

Table 1.  Query Parameters

 

Request Header NameValue
AuthorizationAuthorization parameters dictated by the OAuth Body Hash Protocol
AcceptA comma-separated list containing at least one of the following media types:
Table 2.  Required HTTP Headers for GET Request

 

Table 3 describes the possible responses from the GET method.

HTTP Status Description
200 OK The request was successful.

The response contains a document in one of the formats specified by the Accept header.

301 Moved Permanently The URI for the requested resource has changed.

In this case, the response body is empty, and the new URI is provided in the Location header. The client should GET the resource from the new location, and furthermore, it should send all future requests to the new location as well.

307 Temporary Redirect The requested resource resides temporarily under a different URI.

In this case, the response body is empty, and the temporary URI is defined by the Location header field. The client should GET the resource at the temporary URI, but future requests should continue to be sent to the original URI.

401 Unauthorized The client did not authenticate properly.
404 Not Found The server has not found anything matching the request URI.
406 Not Acceptable The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.
500 Internal Service Error The server encountered an unexpected condition which prevented it from fulfilling the request.
Table 3.  Possible responses from a GET method

4.2 PUT

To update a collection of Tool Settings, the client submits an HTTP PUT request to the appropriate endpoint in accordance with the following rules:

 

Request Header NameValue
Content-TypeOne of:
  • application/vnd.ims.lti.v2.toolsettings+json
  • application/vnd.ims.lti.v2.toolsettings.simple+json
AuthorizationAuthorization parameters dictated by the OAuth Body Hash Protocol
Table 4.  Required HTTP Headers for PUT Request

 

Table 5 describes the possible responses from the PUT method. In all cases, the response body is empty.

HTTP Status Description
200 OK The request was successful.
401 Unauthorized The client did not authenticate properly.
404 Not Found The server has not found anything matching the request URI.
500 Internal Service Error The server encountered an unexpected condition which prevented it from fulfilling the request.
Table 5.  Possible responses from a PUT method

About this Document

Title: A REST API for Tool Settings in multiple formats
Editor:Stephen Vickers (IMS Global)
Version: 1.0
Version Date: 10 September 2015
Release: Final Release
Status: IMS Final Release
Purpose: This document is made available for review and comment by the public community at large.

List of Contributors

The following list of individuals contributed to the authoring of this document:

Craig DunkD2LPadraig O'hiceadhaHMH
Viktor HaagD2LCharles SeveranceIMS Global
Brad HumphreyInstructureColin SmytheIMS Global
Greg McFallPearsonMatt StoeltingCengage
Mark McKellIMS GlobalJohn TibbettsVitalsource
Bracken MosbackerLumen LearningClaude VervoortCengage
Lance NeumannBlackboardStephen VickersIMS Global