Package content items into a signed response JWT for the platform.
When the platform sends an LtiDeepLinkingRequest launch, your tool
presents a selection UI and calls build_response/3 with the chosen
items. The response JWT is then POSTed back to the platform's return URL.
Content items are built with these modules:
Ltix.DeepLinking.ContentItem.LtiResourceLink— an LTI activity the platform will link toLtix.DeepLinking.ContentItem.Link— an external URLLtix.DeepLinking.ContentItem.File— a downloadable fileLtix.DeepLinking.ContentItem.HtmlFragment— inline HTML to embedLtix.DeepLinking.ContentItem.Image— an image for direct rendering
See the Deep Linking guide for the full workflow and Building Content Items for recipes.
Summary
Functions
Build a signed Deep Linking response JWT.
Functions
@spec build_response(Ltix.LaunchContext.t(), list(), keyword()) :: {:ok, Ltix.DeepLinking.Response.t()} | {:error, Exception.t()}
Build a signed Deep Linking response JWT.
Takes a LaunchContext from an LtiDeepLinkingRequest launch, a list of
content items, and optional message/log fields. Returns a Response with
the signed JWT and the platform's return URL.
Options
:msg— user-facing message to show on return:log— log message for the platform:error_message— user-facing error message:error_log— error log message for the platform
Errors
Ltix.Errors.Invalid.InvalidMessageType— context is not a deep linking launchLtix.Errors.Invalid.ContentItemTypeNotAccepted— item type not inaccept_typesLtix.Errors.Invalid.ContentItemsExceedLimit— multiple items whenaccept_multipleisfalseLtix.Errors.Invalid.LineItemNotAccepted— line item present whenaccept_lineitemisfalse
Examples
{:ok, link} = Ltix.DeepLinking.ContentItem.LtiResourceLink.new(
url: "https://tool.example.com/activity/123",
title: "Quiz 1"
)
{:ok, response} = Ltix.DeepLinking.build_response(context, [link],
msg: "Selected 1 item"
)
# response.jwt — signed JWT to POST to response.return_urlSee the Deep Linking guide for the full workflow.