Skip to content

Edit external_url of ModuleItem returns error #633

Answered by Thetwam
maxjeltes asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @maxjeltes,

According to the Canvas docs for editing a module item, changing the external URL requires the parameter module_item[external_url]. Since brackets aren't allowed in argument names in Python, the CanvasAPI library requires you to use an argument called module_item and set it equal to a dictionary containing a key called external_url. What you have is close, but the name of the argument is important.

Try the following:

module_item.edit(module_item={'external_url' : 'https://google.com'})

For more information about how CanvasAPI handles keyword arguments, check out our keyword argument documentation. In particular, take a look at the Nested Parameters section.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@maxjeltes
Comment options

Answer selected by maxjeltes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants