Uploading the user avatar with REST

With REST it’s possible to GET or PUT an attachment file to a page.
Is it possible to do that with the avatar of the user that is also attachment ?

Camille Desmots

I found.
The URL for the avatar with REST will be :
/rest/wikis/< Your wiki name>/spaces/XWiki/pages/<Your user name>/attachments/<the name of the file>
For example :

Actually there is two sides:

  • you indeed need to upload the avatar image as attachment
  • you also need to make sure this is the selected file in property with name ‘avatar’ located in the object with class XWiki.XWikiUsers
1 Like