Ltix.LaunchClaims.DeepLinkingSettings (Ltix v0.2.0)

Copy Markdown View Source

Platform preferences for a Deep Linking content selection.

Sent by the platform in an LtiDeepLinkingRequest launch to specify what kinds of content items are accepted.

Required fields

  • :deep_link_return_url - where the tool posts the response JWT
  • :accept_types - content item types the platform accepts (e.g., ["ltiResourceLink", "link"])
  • :accept_presentation_document_targets - how the content may be presented (e.g., ["iframe", "window"])

Optional fields

  • :accept_media_types - comma-separated MIME types for file items
  • :accept_multiple - whether multiple items may be returned
  • :accept_line_item - whether the platform will create line items
  • :auto_create - whether the platform will auto-create resources
  • :title - suggested title for the content selection UI
  • :text - suggested description for the content selection UI
  • :data - opaque value the tool must return unchanged in the response

See the Deep Linking guide for using these settings.

Summary

Functions

Parse a deep linking settings claim from a JSON map.

Types

t()

@type t() :: %Ltix.LaunchClaims.DeepLinkingSettings{
  accept_line_item: nil | boolean(),
  accept_media_types: nil | binary(),
  accept_multiple: nil | boolean(),
  accept_presentation_document_targets: [binary()],
  accept_types: [binary()],
  auto_create: nil | boolean(),
  data: nil | nil | any(),
  deep_link_return_url: binary(),
  text: nil | binary(),
  title: nil | binary()
}

Functions

from_json(json)

@spec from_json(map()) :: {:ok, t()} | {:error, Exception.t()}

Parse a deep linking settings claim from a JSON map.

Examples

iex> json = %{
...>   "deep_link_return_url" => "https://example.com/return",
...>   "accept_types" => ["link"],
...>   "accept_presentation_document_targets" => ["iframe"]
...> }
iex> {:ok, settings} = Ltix.LaunchClaims.DeepLinkingSettings.from_json(json)
iex> settings.deep_link_return_url
"https://example.com/return"
iex> settings.accept_types
["link"]