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:

  • http://example.com/done?return_type=url&url=https%3A%2F%2Fothersite.com%2link&
  • http://example.com/done?return_type=url&url=https%3A%2F%2Fothersite.com%2link&text=text%20for%20link
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:

  • http://example.com/done?return_type=url
                           &url=https%3A%2F%2Fothersite.com%2file.pdf
                           &text=file.pdf
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:

  • http://example.com/done?return_type=image_url
                           &url=https%3A%2F%2Fothersite.com%2Fimage.gif
                           &alt=good+picture
                           &width=30
                           &height=50
  • http://example.com/done?return_type=image_url
                           &url=https%3A%2F%2Fothersite.com%2Fimage2.gif
                           &alt=
                           &width=300
                           &height=500
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:

  • http://example.com/done?return_type=iframe
                           &url=https%3A%2F%2Fothersite.com%2link
  • http://example.com/done?return_type=iframe
                           &url=https%3A%2F%2Fothersite.com%2link
                           &title=great%20content
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:

  • http://example.com/done?return_type=lti_launch_url
              &url=https%3A%2F%2Fothersite.com%2lti_link
  • http://example.com/done?return_type=lti_launch_url
              &url=https%3A%2F%2Fothersite.com%2Flti_link%3Fkey%3Dval%26key2%3Dval2
  • http://example.com/done?return_type=lti_launch_url
              &url=https%3A%2F%2Fothersite.com%2lti_link
              &title=hey%20there
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:

  • http://www.example.com/done?return_type=oembed
                           &endpoint=https%3A%2F%2Fothersite.com%2Foembed
                           &url=https%3A%2F%2Fothersite.com%2Fresources%2Fimage1
  • http://www.example.com/done?return_type=oembed
                           &endpoint=http%3A%2F%2Fwww.flickr.com%2Fservices%2Foembed%2F
                           &url=http%3A%2F%2Fwww.flickr.com%2Fphotos%2Fbees%2F2341623661%2F