AnsweredAssumed Answered

Can I use the API to remove an avatar URL?

Question asked by Joshua Swink on Nov 4, 2015
Latest reply on Nov 12, 2015 by Joshua Swink

When I try to remove an avatar URL with the API, it ends up being the URL of the Canvas instance instead. Is there a way to remove the URL?

 

Let's say I am going to add an avatar URL to a user. Before I add it, "avatar_url" is empty:

 

{"id":4696,"name":"xxx yyy","sortable_name":"yyy, xxx","short_name":"xxx yyy","sis_user_id":"1234567","integration_id":null,"sis_login_id":"xyyy",

"sis_import_id":1000,"login_id":"xyyy","avatar_url":"","email":"xyyy@ucmerced.edu","locale":null}

 

Then I set it to something (Users - Canvas LMS REST API Documentation):

 

curl -i -X PUT -F user[avatar][url]=http://example/xyyy.jpg https://ucmerced.test.instructure.com/api/v1/users/sis_user_id%3A1234567

 

Then "avatar_url" is "http://example/xyyy.jpg".

 

I try to remove it:

 

curl -i -X PUT -F user[avatar][url]= https://ucmerced.test.instructure.com/api/v1/users/sis_user_id%3A1234567

 

It's now the URL of the instance ("https://ucmerced.test.instructure.com") instead of being empty:

 

{"id":4696,"name":"xxx yyy","sortable_name":"yyy, xxx","short_name":"xxx yyy","sis_user_id":"1234567","integration_id":null,"sis_login_id":"xyyy",

"sis_import_id":1000,"login_id":"xyyy","avatar_url":"https://ucmerced.test.instructure.com","email":"xyyy@ucmerced.edu","locale":null}

Outcomes