Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
Found this content helpful? Log in or sign up to leave a like!
Hi all.
We at the University of Michigan are developing an integration between our Identity system and Canvas. An important aspect to this is the ability to update a Canvas user accounts when a user's name or email changes. We have not found a way to update the user's primary email address via the communication_channels API. We can create a new email address. But we cannot switch the primary email address to this new one, nor delete the original. Ideally, we would be able to modify the default email address without creating a new one and deleting, but a workaround would be fine in the interim.
Have any of you run into this same problem? Were you able to design a suitable solution via the API?
- Chris
Solved! Go to Solution.
Hooray! The solution was found in our Canvas root account permissions. Setting this option: Users can delete their institution-assigned email address Allowed us to do what we needed. There are business implications to this that we will need to sort through, but it does allow the technical workflow we desire. Let me know if anyone has any questions about this. - Chris
I have found a way to update the default email address. List the user's communication_channels, then update the default using this call:
So, my request is down to one question, how do I delete the original default email address? After setting the new default using the call above, the original email address cannot be deleted. I receive an unauthorized message when attempting to delete:
DELETE https://myinstance.instructure.com/api/v1/users/:user_id/communication_channels/:id
{"status":"unauthorized","errors":[{"message":"user not authorized to perform that action"}]} This is not a permission issue, as I am using the token for a user with complete permissions across our instance.
Any ideas?
- Chris
I'm just guessing, but perhaps you need to masquerade as the user?
However, last week I spent some time trying to masquerade per the API documentation without success.
Good luck!
Thank you for replying Daniel, I can make this API call, and it appears to be syntactically correct, but the outcome is still the same: the user cannot delete their own communication channel:
I've also tried masquerading as an admin to delete the channel without success.
- Chris
Hooray! The solution was found in our Canvas root account permissions. Setting this option: Users can delete their institution-assigned email address Allowed us to do what we needed. There are business implications to this that we will need to sort through, but it does allow the technical workflow we desire. Let me know if anyone has any questions about this. - Chris
How I have found to update anything in the user account is to send up another user creation file (Canvas LMS REST API Documentation - User.csv). By doing so I have been able to update, first and last names as well as the default/primary email address. This also allows you to turn back on the student cannot delete institutions default email address option and will allow you to keep your student information system in sync with Canvas.
Brian
Chris,
I haven't had any luck changing the default email. When you say:
Do you mean the communication channel id? I've tried that, as well as the actual email address and none of them seem to take. I get back a 200, but the original email is still the default.
Chris
Hi Chris,
The following:
PUT https://myinstance.instructure.com/api/v1/users/:user_id?user[email]=newemail@institution.edu
...will create a new email address for the user and set it in the first position (default) in her profile. Resetting the default email requires the following administrative setting to be toggled on:
"Users can delete their institution-assigned email address"
- Chris
To participate in the Instructure Community, you need to sign up or log in:
Sign In