Update Avatar URL for a user through Automation

Hello,

We have a requirement to update user's Avatar through automation job. Can anyone suggest how we can achieve this?

Thanks

Parents Reply
  • There is a core_v2_http Script API  widget API that will assist with making a REST Request.  

    If Remote Avatars are allowed for users, you should be able to just directly set the AvatarUrl to the remote Url.

    If remote Avatars are not allowed, or for group Avatars (which don't support setting the Url), you would need to use the Upload options when setting the avatar.  Upload the file to temporary storage and use FileUploadContext or Get the file in Byte[] format and use FileData parameter.

Children
  • I have also filed a bug to have Group and User Avatar API calls added to the Velocity APIs.  That is another option as well, to create a custom velocity API that calls the In process APis and use that in your automation.  That is what the bug will fix, in the mean time you could use your custom velocity calls.  That would make it easier than using a REST call.

    TE-17609: User Avatar and Group Avatar only have REST API Endpoint available, they should be added to the Widget APIs as well

    Completed for 13.0

  • We are able to update the avatar url for a user in the Widget Script. But inside automation, the avatar url is not getting updated using core_v2_http Script API. (Remote Avatars are allowed for users)

    We are using below automation code in Javascript to update avatar url.

    var url="https://community-qa.thomsonreuters.com/api.ashx/v2/users/"+userID+"/avatar.json";
    var Data= '{"AvatarUrl": "https://xxxxxxx.com/xxxx.png"}';
    var httpResponseResponse = core_v2_http.Put(url, { Data: Data, Headers: {"Rest-User-Token": 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'application/json'}});


    Can you please suggest how we can update avatar url in automation using javascript?