CreateExternalToolDTO
extends AbstractBaseDto
in package
implements
DTOInterface
Data Transfer Object for creating external tools in Canvas LMS
This DTO handles the creation of new external tools (LTI integrations) with all the necessary fields supported by the Canvas API. External tools are IMS LTI links that extend Canvas functionality with third-party educational applications.
Table of Contents
Interfaces
Constants
- PLACEMENT_PROPERTIES = ['accountNavigation' => 'account_navigation', 'assignmentSelection' => 'assignment_selection', 'courseHomeSubNavigation' => 'course_home_sub_navigation', 'courseNavigation' => 'course_navigation', 'editorButton' => 'editor_button', 'homeworkSubmission' => 'homework_submission', 'linkSelection' => 'link_selection', 'migrationSelection' => 'migration_selection', 'resourceSelection' => 'resource_selection', 'toolConfiguration' => 'tool_configuration', 'userNavigation' => 'user_navigation']
- Placement configuration property names that need nested array handling
Properties
- $accountNavigation : array<string, mixed>|null
- The configuration for account navigation links
- $configType : string|null
- Configuration can be passed in as CC xml instead of using query parameters Allowed values: by_url, by_xml
- $configUrl : string|null
- URL where the server can retrieve an XML tool configuration Required if config_type is set to "by_url"
- $configXml : string|null
- XML tool configuration, as specified in the CC xml specification Required if config_type is set to "by_xml"
- $consumerKey : string|null
- The consumer key for the external tool (required)
- $courseHomeSubNavigation : array<string, mixed>|null
- The configuration for course home navigation links
- $courseNavigation : array<string, mixed>|null
- The configuration for course navigation links
- $customFields : array<string, string>|null
- Custom fields that will be sent to the tool consumer
- $description : string|null
- A description of the tool
- $domain : string|null
- The domain to match links against (either url or domain should be set, not both)
- $editorButton : array<string, mixed>|null
- The configuration for a WYSIWYG editor button
- $homeworkSubmission : array<string, mixed>|null
- The configuration for homework submission selection
- $iconUrl : string|null
- The url of the icon to show for this tool
- $isRceFavorite : bool|null
- Whether this tool should appear in a preferred location in the RCE (Deprecated in favor of Mark tool to RCE Favorites)
- $linkSelection : array<string, mixed>|null
- The configuration for link selection
- $migrationSelection : array<string, mixed>|null
- The configuration for migration selection
- $name : string|null
- External tool name (required)
- $notSelectable : bool|null
- If set to true, and if resource_selection is set to false, the tool won't show up in the external tool selection UI
- $oauthCompliant : bool|null
- If set to true LTI query params will not be copied to the post body
- $privacyLevel : string|null
- How much user information to send to the external tool (required) Allowed values: anonymous, name_only, email_only, public
- $resourceSelection : array<string, mixed>|null
- The configuration for a resource selector in modules
- $sharedSecret : string|null
- The shared secret with the external tool (required)
- $text : string|null
- The default text to show for this tool
- $toolConfiguration : array<string, mixed>|null
- The configuration for a tool configuration link
- $unifiedToolId : string|null
- The unique identifier for the tool in LearnPlatform
- $url : string|null
- The url to match links against (either url or domain should be set, not both)
- $userNavigation : array<string, mixed>|null
- The configuration for user navigation links
- $apiPropertyName : string
- The API property name for multipart requests
Methods
- __construct() : mixed
- BaseDto constructor.
- getAccountNavigation() : array<string, mixed>|null
- Get account navigation configuration
- getConfigType() : string|null
- Get config type
- getConfigUrl() : string|null
- Get config URL
- getConfigXml() : string|null
- Get config XML
- getConsumerKey() : string|null
- Get consumer key
- getCourseHomeSubNavigation() : array<string, mixed>|null
- Get course home sub navigation configuration
- getCourseNavigation() : array<string, mixed>|null
- Get course navigation configuration
- getCustomFields() : array<string, string>|null
- Get custom fields
- getDescription() : string|null
- Get description
- getDomain() : string|null
- Get domain
- getEditorButton() : array<string, mixed>|null
- Get editor button configuration
- getHomeworkSubmission() : array<string, mixed>|null
- Get homework submission configuration
- getIconUrl() : string|null
- Get icon URL
- getIsRceFavorite() : bool|null
- Get RCE favorite status
- getLinkSelection() : array<string, mixed>|null
- Get link selection configuration
- getMigrationSelection() : array<string, mixed>|null
- Get migration selection configuration
- getName() : string|null
- Get external tool name
- getNotSelectable() : bool|null
- Get not selectable status
- getOauthCompliant() : bool|null
- Get OAuth compliant status
- getPrivacyLevel() : string|null
- Get privacy level
- getResourceSelection() : array<string, mixed>|null
- Get resource selection configuration
- getSharedSecret() : string|null
- Get shared secret
- getText() : string|null
- Get text
- getToolConfiguration() : array<string, mixed>|null
- Get tool configuration
- getUnifiedToolId() : string|null
- Get unified tool ID
- getUrl() : string|null
- Get URL
- getUserNavigation() : array<string, mixed>|null
- Get user navigation configuration
- setAccountNavigation() : void
- Set account navigation configuration
- setAccountNavigationEnabled() : void
- Set account navigation enabled status
- setAccountNavigationText() : void
- Set account navigation text
- setAccountNavigationUrl() : void
- Set account navigation URL
- setConfigType() : void
- Set config type
- setConfigUrl() : void
- Set config URL
- setConfigXml() : void
- Set config XML
- setConsumerKey() : void
- Set consumer key
- setCourseHomeSubNavigation() : void
- Set course home sub navigation configuration
- setCourseNavigation() : void
- Set course navigation configuration
- setCourseNavigationDefault() : void
- Set course navigation default state
- setCourseNavigationEnabled() : void
- Set course navigation enabled status
- setCourseNavigationText() : void
- Set course navigation text
- setCourseNavigationVisibility() : void
- Set course navigation visibility
- setCourseNavigationWindowTarget() : void
- Set course navigation window target
- setCustomFields() : void
- Set custom fields
- setDescription() : void
- Set description
- setDomain() : void
- Set domain
- setEditorButton() : void
- Set editor button configuration
- setEditorButtonEnabled() : void
- Set editor button enabled status
- setEditorButtonIconUrl() : void
- Set editor button icon URL
- setEditorButtonMessageType() : void
- Set editor button message type
- setEditorButtonSelectionHeight() : void
- Set editor button selection height
- setEditorButtonSelectionWidth() : void
- Set editor button selection width
- setEditorButtonUrl() : void
- Set editor button URL
- setHomeworkSubmission() : void
- Set homework submission configuration
- setIconUrl() : void
- Set icon URL
- setIsRceFavorite() : void
- Set RCE favorite status
- setLinkSelection() : void
- Set link selection configuration
- setMigrationSelection() : void
- Set migration selection configuration
- setName() : void
- Set external tool name
- setNotSelectable() : void
- Set not selectable status
- setOauthCompliant() : void
- Set OAuth compliant status
- setPrivacyLevel() : void
- Set privacy level
- setResourceSelection() : void
- Set resource selection configuration
- setResourceSelectionEnabled() : void
- Set resource selection enabled status
- setResourceSelectionHeight() : void
- Set resource selection height
- setResourceSelectionIconUrl() : void
- Set resource selection icon URL
- setResourceSelectionUrl() : void
- Set resource selection URL
- setResourceSelectionWidth() : void
- Set resource selection width
- setSharedSecret() : void
- Set shared secret
- setText() : void
- Set text
- setToolConfiguration() : void
- Set tool configuration
- setUnifiedToolId() : void
- Set unified tool ID
- setUrl() : void
- Set URL
- setUserNavigation() : void
- Set user navigation configuration
- toApiArray() : array<string|int, array{name: string, contents: mixed}>
- Convert the DTO to an array for API requests with custom handling for placement configurations
- toArray() : array<string|int, mixed>
- Convert the DTO to an array
Constants
PLACEMENT_PROPERTIES
Placement configuration property names that need nested array handling
private
mixed
PLACEMENT_PROPERTIES
= ['accountNavigation' => 'account_navigation', 'assignmentSelection' => 'assignment_selection', 'courseHomeSubNavigation' => 'course_home_sub_navigation', 'courseNavigation' => 'course_navigation', 'editorButton' => 'editor_button', 'homeworkSubmission' => 'homework_submission', 'linkSelection' => 'link_selection', 'migrationSelection' => 'migration_selection', 'resourceSelection' => 'resource_selection', 'toolConfiguration' => 'tool_configuration', 'userNavigation' => 'user_navigation']
Properties
$accountNavigation
The configuration for account navigation links
public
array<string, mixed>|null
$accountNavigation
= null
$configType
Configuration can be passed in as CC xml instead of using query parameters Allowed values: by_url, by_xml
public
string|null
$configType
= null
$configUrl
URL where the server can retrieve an XML tool configuration Required if config_type is set to "by_url"
public
string|null
$configUrl
= null
$configXml
XML tool configuration, as specified in the CC xml specification Required if config_type is set to "by_xml"
public
string|null
$configXml
= null
$consumerKey
The consumer key for the external tool (required)
public
string|null
$consumerKey
= null
$courseHomeSubNavigation
The configuration for course home navigation links
public
array<string, mixed>|null
$courseHomeSubNavigation
= null
$courseNavigation
The configuration for course navigation links
public
array<string, mixed>|null
$courseNavigation
= null
$customFields
Custom fields that will be sent to the tool consumer
public
array<string, string>|null
$customFields
= null
$description
A description of the tool
public
string|null
$description
= null
$domain
The domain to match links against (either url or domain should be set, not both)
public
string|null
$domain
= null
$editorButton
The configuration for a WYSIWYG editor button
public
array<string, mixed>|null
$editorButton
= null
$homeworkSubmission
The configuration for homework submission selection
public
array<string, mixed>|null
$homeworkSubmission
= null
$iconUrl
The url of the icon to show for this tool
public
string|null
$iconUrl
= null
$isRceFavorite
Whether this tool should appear in a preferred location in the RCE (Deprecated in favor of Mark tool to RCE Favorites)
public
bool|null
$isRceFavorite
= null
$linkSelection
The configuration for link selection
public
array<string, mixed>|null
$linkSelection
= null
$migrationSelection
The configuration for migration selection
public
array<string, mixed>|null
$migrationSelection
= null
$name
External tool name (required)
public
string|null
$name
= null
$notSelectable
If set to true, and if resource_selection is set to false, the tool won't show up in the external tool selection UI
public
bool|null
$notSelectable
= null
$oauthCompliant
If set to true LTI query params will not be copied to the post body
public
bool|null
$oauthCompliant
= null
$privacyLevel
How much user information to send to the external tool (required) Allowed values: anonymous, name_only, email_only, public
public
string|null
$privacyLevel
= null
$resourceSelection
The configuration for a resource selector in modules
public
array<string, mixed>|null
$resourceSelection
= null
$sharedSecret
The shared secret with the external tool (required)
public
string|null
$sharedSecret
= null
$text
The default text to show for this tool
public
string|null
$text
= null
$toolConfiguration
The configuration for a tool configuration link
public
array<string, mixed>|null
$toolConfiguration
= null
$unifiedToolId
The unique identifier for the tool in LearnPlatform
public
string|null
$unifiedToolId
= null
$url
The url to match links against (either url or domain should be set, not both)
public
string|null
$url
= null
$userNavigation
The configuration for user navigation links
public
array<string, mixed>|null
$userNavigation
= null
$apiPropertyName
The API property name for multipart requests
protected
string
$apiPropertyName
= 'external_tool'
Methods
__construct()
BaseDto constructor.
public
__construct(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
Tags
getAccountNavigation()
Get account navigation configuration
public
getAccountNavigation() : array<string, mixed>|null
Return values
array<string, mixed>|nullgetConfigType()
Get config type
public
getConfigType() : string|null
Return values
string|nullgetConfigUrl()
Get config URL
public
getConfigUrl() : string|null
Return values
string|nullgetConfigXml()
Get config XML
public
getConfigXml() : string|null
Return values
string|nullgetConsumerKey()
Get consumer key
public
getConsumerKey() : string|null
Return values
string|nullgetCourseHomeSubNavigation()
Get course home sub navigation configuration
public
getCourseHomeSubNavigation() : array<string, mixed>|null
Return values
array<string, mixed>|nullgetCourseNavigation()
Get course navigation configuration
public
getCourseNavigation() : array<string, mixed>|null
Return values
array<string, mixed>|nullgetCustomFields()
Get custom fields
public
getCustomFields() : array<string, string>|null
Return values
array<string, string>|nullgetDescription()
Get description
public
getDescription() : string|null
Return values
string|nullgetDomain()
Get domain
public
getDomain() : string|null
Return values
string|nullgetEditorButton()
Get editor button configuration
public
getEditorButton() : array<string, mixed>|null
Return values
array<string, mixed>|nullgetHomeworkSubmission()
Get homework submission configuration
public
getHomeworkSubmission() : array<string, mixed>|null
Return values
array<string, mixed>|nullgetIconUrl()
Get icon URL
public
getIconUrl() : string|null
Return values
string|nullgetIsRceFavorite()
Get RCE favorite status
public
getIsRceFavorite() : bool|null
Return values
bool|nullgetLinkSelection()
Get link selection configuration
public
getLinkSelection() : array<string, mixed>|null
Return values
array<string, mixed>|nullgetMigrationSelection()
Get migration selection configuration
public
getMigrationSelection() : array<string, mixed>|null
Return values
array<string, mixed>|nullgetName()
Get external tool name
public
getName() : string|null
Return values
string|nullgetNotSelectable()
Get not selectable status
public
getNotSelectable() : bool|null
Return values
bool|nullgetOauthCompliant()
Get OAuth compliant status
public
getOauthCompliant() : bool|null
Return values
bool|nullgetPrivacyLevel()
Get privacy level
public
getPrivacyLevel() : string|null
Return values
string|nullgetResourceSelection()
Get resource selection configuration
public
getResourceSelection() : array<string, mixed>|null
Return values
array<string, mixed>|nullgetSharedSecret()
Get shared secret
public
getSharedSecret() : string|null
Return values
string|nullgetText()
Get text
public
getText() : string|null
Return values
string|nullgetToolConfiguration()
Get tool configuration
public
getToolConfiguration() : array<string, mixed>|null
Return values
array<string, mixed>|nullgetUnifiedToolId()
Get unified tool ID
public
getUnifiedToolId() : string|null
Return values
string|nullgetUrl()
Get URL
public
getUrl() : string|null
Return values
string|nullgetUserNavigation()
Get user navigation configuration
public
getUserNavigation() : array<string, mixed>|null
Return values
array<string, mixed>|nullsetAccountNavigation()
Set account navigation configuration
public
setAccountNavigation(array<string, mixed>|null $accountNavigation) : void
Parameters
- $accountNavigation : array<string, mixed>|null
setAccountNavigationEnabled()
Set account navigation enabled status
public
setAccountNavigationEnabled(bool|null $enabled) : void
Parameters
- $enabled : bool|null
setAccountNavigationText()
Set account navigation text
public
setAccountNavigationText(string|null $text) : void
Parameters
- $text : string|null
setAccountNavigationUrl()
Set account navigation URL
public
setAccountNavigationUrl(string|null $url) : void
Parameters
- $url : string|null
setConfigType()
Set config type
public
setConfigType(string|null $configType) : void
Parameters
- $configType : string|null
setConfigUrl()
Set config URL
public
setConfigUrl(string|null $configUrl) : void
Parameters
- $configUrl : string|null
setConfigXml()
Set config XML
public
setConfigXml(string|null $configXml) : void
Parameters
- $configXml : string|null
setConsumerKey()
Set consumer key
public
setConsumerKey(string|null $consumerKey) : void
Parameters
- $consumerKey : string|null
setCourseHomeSubNavigation()
Set course home sub navigation configuration
public
setCourseHomeSubNavigation(array<string, mixed>|null $courseHomeSubNavigation) : void
Parameters
- $courseHomeSubNavigation : array<string, mixed>|null
setCourseNavigation()
Set course navigation configuration
public
setCourseNavigation(array<string, mixed>|null $courseNavigation) : void
Parameters
- $courseNavigation : array<string, mixed>|null
setCourseNavigationDefault()
Set course navigation default state
public
setCourseNavigationDefault(string|null $default) : void
Parameters
- $default : string|null
setCourseNavigationEnabled()
Set course navigation enabled status
public
setCourseNavigationEnabled(bool|null $enabled) : void
Parameters
- $enabled : bool|null
setCourseNavigationText()
Set course navigation text
public
setCourseNavigationText(string|null $text) : void
Parameters
- $text : string|null
setCourseNavigationVisibility()
Set course navigation visibility
public
setCourseNavigationVisibility(string|null $visibility) : void
Parameters
- $visibility : string|null
setCourseNavigationWindowTarget()
Set course navigation window target
public
setCourseNavigationWindowTarget(string|null $windowTarget) : void
Parameters
- $windowTarget : string|null
setCustomFields()
Set custom fields
public
setCustomFields(array<string, string>|null $customFields) : void
Parameters
- $customFields : array<string, string>|null
setDescription()
Set description
public
setDescription(string|null $description) : void
Parameters
- $description : string|null
setDomain()
Set domain
public
setDomain(string|null $domain) : void
Parameters
- $domain : string|null
setEditorButton()
Set editor button configuration
public
setEditorButton(array<string, mixed>|null $editorButton) : void
Parameters
- $editorButton : array<string, mixed>|null
setEditorButtonEnabled()
Set editor button enabled status
public
setEditorButtonEnabled(bool|null $enabled) : void
Parameters
- $enabled : bool|null
setEditorButtonIconUrl()
Set editor button icon URL
public
setEditorButtonIconUrl(string|null $iconUrl) : void
Parameters
- $iconUrl : string|null
setEditorButtonMessageType()
Set editor button message type
public
setEditorButtonMessageType(string|null $messageType) : void
Parameters
- $messageType : string|null
setEditorButtonSelectionHeight()
Set editor button selection height
public
setEditorButtonSelectionHeight(string|null $selectionHeight) : void
Parameters
- $selectionHeight : string|null
setEditorButtonSelectionWidth()
Set editor button selection width
public
setEditorButtonSelectionWidth(string|null $selectionWidth) : void
Parameters
- $selectionWidth : string|null
setEditorButtonUrl()
Set editor button URL
public
setEditorButtonUrl(string|null $url) : void
Parameters
- $url : string|null
setHomeworkSubmission()
Set homework submission configuration
public
setHomeworkSubmission(array<string, mixed>|null $homeworkSubmission) : void
Parameters
- $homeworkSubmission : array<string, mixed>|null
setIconUrl()
Set icon URL
public
setIconUrl(string|null $iconUrl) : void
Parameters
- $iconUrl : string|null
setIsRceFavorite()
Set RCE favorite status
public
setIsRceFavorite(bool|null $isRceFavorite) : void
Parameters
- $isRceFavorite : bool|null
setLinkSelection()
Set link selection configuration
public
setLinkSelection(array<string, mixed>|null $linkSelection) : void
Parameters
- $linkSelection : array<string, mixed>|null
setMigrationSelection()
Set migration selection configuration
public
setMigrationSelection(array<string, mixed>|null $migrationSelection) : void
Parameters
- $migrationSelection : array<string, mixed>|null
setName()
Set external tool name
public
setName(string|null $name) : void
Parameters
- $name : string|null
setNotSelectable()
Set not selectable status
public
setNotSelectable(bool|null $notSelectable) : void
Parameters
- $notSelectable : bool|null
setOauthCompliant()
Set OAuth compliant status
public
setOauthCompliant(bool|null $oauthCompliant) : void
Parameters
- $oauthCompliant : bool|null
setPrivacyLevel()
Set privacy level
public
setPrivacyLevel(string|null $privacyLevel) : void
Parameters
- $privacyLevel : string|null
setResourceSelection()
Set resource selection configuration
public
setResourceSelection(array<string, mixed>|null $resourceSelection) : void
Parameters
- $resourceSelection : array<string, mixed>|null
setResourceSelectionEnabled()
Set resource selection enabled status
public
setResourceSelectionEnabled(bool|null $enabled) : void
Parameters
- $enabled : bool|null
setResourceSelectionHeight()
Set resource selection height
public
setResourceSelectionHeight(string|null $selectionHeight) : void
Parameters
- $selectionHeight : string|null
setResourceSelectionIconUrl()
Set resource selection icon URL
public
setResourceSelectionIconUrl(string|null $iconUrl) : void
Parameters
- $iconUrl : string|null
setResourceSelectionUrl()
Set resource selection URL
public
setResourceSelectionUrl(string|null $url) : void
Parameters
- $url : string|null
setResourceSelectionWidth()
Set resource selection width
public
setResourceSelectionWidth(string|null $selectionWidth) : void
Parameters
- $selectionWidth : string|null
setSharedSecret()
Set shared secret
public
setSharedSecret(string|null $sharedSecret) : void
Parameters
- $sharedSecret : string|null
setText()
Set text
public
setText(string|null $text) : void
Parameters
- $text : string|null
setToolConfiguration()
Set tool configuration
public
setToolConfiguration(array<string, mixed>|null $toolConfiguration) : void
Parameters
- $toolConfiguration : array<string, mixed>|null
setUnifiedToolId()
Set unified tool ID
public
setUnifiedToolId(string|null $unifiedToolId) : void
Parameters
- $unifiedToolId : string|null
setUrl()
Set URL
public
setUrl(string|null $url) : void
Parameters
- $url : string|null
setUserNavigation()
Set user navigation configuration
public
setUserNavigation(array<string, mixed>|null $userNavigation) : void
Parameters
- $userNavigation : array<string, mixed>|null
toApiArray()
Convert the DTO to an array for API requests with custom handling for placement configurations
public
toApiArray() : array<string|int, array{name: string, contents: mixed}>
Return values
array<string|int, array{name: string, contents: mixed}>toArray()
Convert the DTO to an array
public
toArray() : array<string|int, mixed>