[API] Simplify avatar management

Problem statement:

For schools that want to use the Canvas API to manage all users' avatars to have them inline with the institutions current user profile photos (e.g. K-12 student yearly professional photos), it would be helpful to simplify the process of determining what their current avatar is in Canvas, and uploading a new (current) photo.

Do do this effectively currently, I need to loop over every current user in our SIS and:

Then, if the file needs an update, I need to follow the steps at https://canvas.instructure.com/doc/api/file.file_uploads.html to:

  • Inform Canvas of a new file upload, and receive an upload URL
  • Do the POST request to upload the file
  • Potentially do the GET request to confirm the file has uploaded
 
Proposed solution:

To assist in checking if the "current" Canvas avatar matches what is in the SIS, it would be good to include something like an MD5 hash of the current avatar on the users' profile information. Then a simple GET request on the a user profile would be sufficient to compare to the SIS image. To assist in the upload of the new file, the ability to do a single POST/PUT/PATCH request to the user profile with a new avatar, which returns 200/201 for success should be sufficient to upload the file and have it set to the current avatar. The combination of these two steps would simplify the process greatly, and cut down the number of API requests and processing time required to cross-check current values

 
User role(s):

admin

1 Comment
nathanatkinson
Community Team
Community Team
Status changed to: Open