Content Extension

This extension is used to pass content to the tool consumer from the tool provider.

Introduction

This is a light-weight LTI extension that allows a provider to pass content to the consumer. When a consumer launches with this extension it passes the ext_content_return_types key with a list of supported types for this launch. The provider will then attach the selected content to the launch_presentation_return_url and send the browser back to that url.

Launch Parameters

Name Required Description
ext_content_return_types yes Presence of this key indicates that the consumer is capable of using the content extension. The value should be a comma separated list of: url, image_url, lti_launch_url, iframe, oembed, file, or values agreed upon between consumer and provider.
ext_content_intended_use no A hint to the provider for how the content will be used. One of navigation, homework, embed, or a value agreed upon by consumer and provider.
ext_content_return_url no The url that the provider should redirect the user to with the selected content as query parameters. If not specified the launch_presentation_return_url should be used.
ext_content_file_extensions no A comma separated list of the file extensions that are allowed if there is a file return type.

Tool Provider Response

The provider should present the user with a UI for selecting content. Once the user has selected the content the provider should redirect the user back to the ext_content_return_url, or if it wasn't sent, to launch_presentation_return_url.

The information for the selected content should be added to query parameters on the return url. The return_type key should specify the type, and the other key/value pairs should be sent as specified in their sections below.

url

Return a url. If the intended use is embed the url will likely be used as an href. If the intended use is something else the extra link info may be discarded.

Name Required Description
return_type yes should have value of url
url yes The url. Likely used as the 'href' attribute of the inserted link
text no this is the suggested text for the inserted link. If the user has already selected some content before opening this dialog, the link will wrap that content and this value may be ignored
title no this is used as the 'title' attribute of the inserted link
target no this is used as the 'target' attribute of the inserted link

examples:

If the launch_presentation_return_url were http://example.com/done, possible return URLs could include:

file

Return a url to a file which the consumer will download.

Name Required Description
return_type yes should have value of file
url yes this is a URL to the file that can be retrieved without requiring any additional authentication (no sessions, cookies, etc.)
text yes the filename
content_type no content or MIME type of the file to be retrieved

examples:

If the launch_presentation_return_url were http://example.com/done, possible return URLs could include:

image_url

Used to return a url to an image. It is generally implied the image will be placed with an img tag in the consumer.

Name Required Description
return_type yes should have value of image_url
url yes this is used as the 'src' attribute of the embedded image tag
text no this is used as the 'alt' attribute of the embedded image tag
width no this is used as the 'width' style of the embedded image tag
height no this is used as the 'height' style of the embedded image tag

examples:

If the launch_presentation_return_url were http://example.com/done, possible return URLs could include:

iframe

Return info to embed an iframe.

Name Required Description
return_type yes should have value of iframe
url yes this is used as the 'src' attribute of the embedded iframe
title no this is used as the 'title' attribute of the embedded iframe
width no this is used as the 'width' style of the embedded iframe
height no this is used as the 'height' style of the embedded iframe

examples:

If the launch_presentation_return_url were http://example.com/done, possible return URLs could include:

lti_launch_url

Return an LTI launch url.

Name Required Description
return_type yes should have value of lti_launch_url
url yes this is URL that will be used to load the external tool. Any custom parameters should be in the query string.
title no the title of the resource link or the 'title' attribute of the inserted external tool link
text no this is the suggested text for the inserted link. If the user has already selected some content before opening this dialog, the link will wrap that content and this value will be ignored.

examples:

If the launch_presentation_return_url were http://example.com/done, possible return URLs could include:

oembed

For other types of rich content (such as a video tag, a large block of text, etc.) we also support the oEmbed standard. oEmbed works by giving Canvas an additional URL that can be queried to retrieve the block of content to be embedded. See http://oembed.com for more details about how oEmbed works

Name Required Description
return_type yes should have value of oembed
url yes this is the oEmbed resource URL
endpoint no this is the oEmbed API endpoint URL

examples:

If the launch_presentation_return_url were http://example.com/done, possible return URLs could include: