IMS Public Draft
IMS Public Draft

# A REST API for Result Resources
in the `application/vnd.ims.lis.v2.result+json` Format

Public Draft - Content-Item Message
Date Issued: 7 April 2014
Latest version: http://www.imsglobal.org/lti

IPR and Distribution Notices

Recipients of this document are requested to submit, with their comments, notification of any relevant patent claims or other intellectual property rights of which they may be aware that might be infringed by any implementation of the specification set forth in this document, and to provide supporting documentation.

IMS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on IMS's procedures with respect to rights in IMS specifications can be found at the IMS Intellectual Property Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.

Copyright © 2014 IMS Global Learning Consortium. All Rights Reserved.

Use of this specification to develop products or services is governed by the license with IMS found on the IMS website: http://www.imsglobal.org/license.html.

Permission is granted to all parties to use excerpts from this document as needed in producing requests for proposals.

The limited permissions granted above are perpetual and will not be revoked by IMS or its successors or assigns.

THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTER'S OWN RISK, AND NEITHER THE CONSORTIUM, NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION.

Join the discussion and post comments on the LTI Public Forum: http://www.imsglobal.org/community/forum/categories.cfm?catid=44

© 2014 IMS Global Learning Consortium, Inc.
All Rights Reserved.
The IMS Logo and Learning Tools Interoperability (LTI) are trademarks of the IMS Global Learning Consortium, Inc. in the United States and/or other countries.
v1.0 Public Draft - Revision: 7 April 2014

## Abstract

This specification defines a REST API for reading and updating `Result` resources.

## Table of Contents

## 1. Introduction

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

Implementations of this REST API may be incomplete; a given server might support only a subset of the HTTP verbs. A server that supports the complete API will expose two different kinds of endpoints: a container endpoint for receiving POST requests and item endpoints for manipulating individual instances. This specification document does not prescribe a method for discovering the endpoint URLs.

## 2. Result Representations

`Result` resources manipulated via this REST API are represented as JSON documents in the `application/vnd.ims.lis.v2.result+json` format. For detailed information about this media type, see [Result-media-type].

## 3. Service Methods

### 3.1 GET

To get a representation of a particular Result instance, the client submits an HTTP GET request to the resource's REST endpoint, in accordance with the following rules:

- The request must contain the HTTP headers as specified in Table 1.
- The request body must be empty.

Request Header Name | Value
--- | ---
Authorization | Authorization parameters dictated by the OAuth Body Hash Protocol

Table 1. Required HTTP Headers for GET Request

Table 2 describes the possible responses from the GET method.

HTTP Status | Description
--- | ---
200 OK | The request was successful. The response contains a JSON document in the format defined by the `application/vnd.ims.lis.v2.result+json` media type.
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.
500 Internal Service Error | The server encountered an unexpected condition which prevented it from fulfilling the request.

Table 2. Possible responses from a GET method

### 3.2 GET from a ResultContainer

To get a paginated list of Result resources from a ResultContainer, the client submits an HTTP GET request to the container endpoint in accordance with the following rules:

- The request must contain the HTTP headers as specified in Table 3.

Request Header Name | Value
--- | ---
Authorization | Authorization parameters dictated by the OAuth Body Hash Protocol

Table 3. Required HTTP Headers for GET Request

Table 4 describes the possible responses from the GET method.

HTTP Status | Description
--- | ---
200 OK | The request was successful. The response body contains the first Page of Result resources in the format defined by the `???` media type. This Page has its own URL which is distinct from the URL of the `ResultContainer`. The URL of the first Page is supplied in the `Content-Location` header. Clients should be aware that a server may send a 303 redirect to the first Page (see below) instead of delivering this Page directly in the entity body. Likewise a server may send a 301 or 307 redirect.
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.
303 See Other | This status code signals that the `ResultContainer` itself cannot be delivered in the response. Instead, the client may receive the first page from a paginated list of Result resources at the address specified by the `Location` header.
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.
500 Internal Service Error | The server encountered an unexpected condition which prevented it from fulfilling the request.

Table 4. Possible responses from a GET method

### 3.3 PUT

To update a particular Result instance, the client submits an HTTP PUT request to the resource's REST endpoint in accordance with the following rules:

- The request must contain the HTTP Headers listed in Table 5.
- The request body must contain a JSON document in the format defined by the Content-Type request header.

Request Header Name | Value
--- | ---
Content-Type | `application/vnd.ims.lis.v2.result+json`
AUTHORIZATION | Authorization parameters dictated by the OAuth Body Hash Protocol

Table 5. Required HTTP Headers for PUT Request

Table 6 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 6. Possible responses from a PUT method

## 4. References

[Result-media-type]
  Stephen Vickers. Result JSON Binding in the `application/vnd.ims.lis.v2.result+json` format. IMS Public Draft. 7 April 2014.

## About this Document

Title: | A REST API for Result Resources in the `application/vnd.ims.lis.v2.result+json` Format
Editor: | Stephen Vickers (IMS Global)
Version: | 1.0
Version Date: | 7 April 2014
Release: | Public Draft
Status: | IMS Public Draft
Purpose: | This document is made available for review and comment by the public community at large.
Document Location: | Join the discussion and post comments on the LTI Public Forum: http://www.imsglobal.org/community/forum/categories.cfm?catid=44

### List of Contributors

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

Viktor Haag | Desire2Learn | Bracken Mosbacker | Instructure
Brad Humphrey | Instructure | Claude Vervoort | Cengage
Greg McFall | Pearson | Stephen Vickers | IMS Global Learning Consortium

IMS Global Learning Consortium, Inc. (“IMS Global”) is publishing the information contained in this (“Specification”) for purposes of scientific, experimental, and scholarly collaboration only.

IMS Global makes no warranty or representation regarding the accuracy or completeness of the Specification. This material is provided on an “As Is” and “As Available” basis.

The Specification is at all times subject to change and revision without notice.

It is your sole responsibility to evaluate the usefulness, accuracy, and completeness of the Specification as it relates to you.

IMS Global would appreciate receiving your comments and suggestions.

Please contact IMS Global through our website at http://www.imsglobal.org

Please refer to Document Name: IMS Global Learning Tools Interoperability - Content-Item Message Public Draft v1.0
Revision: 7 April 2014