Call Support:Direct: (214) 420-1337Toll Free: (877)
Monday through Friday 8 a.m. to 6 p.m. Central
I am adding users to the system via calls to PublicApi.Users.Create, however I cannot see where I can update the user's avatar. I can see an equivalent call is available via the REST APi, how do I do it within the PublicAPi?
icauston - I can not find this in the PublicApi either, however I did find two alternatives:
1. The OOTB modal utilizes the following to update a user's uploaded avatar:
using (Stream inputStream = this.UploadedFile.InputStream)
user.AvatarUrl = Telligent.Evolution.Avatars.UpdateAvatar(user.UserID, inputStream);
2. Another possibility would be to use the same IUserService (in the rest namespace) that the REST endpoints use
var avatarService = Services.Get<Telligent.Evolution.Rest.Resources.Users.UserService>();
However I am not sure about the ramifications of using this outside of a REST call, and looking closer, this call uses the same underlying code as in option #1.
Have you thought about just calling the REST endpoint to update the avatar from within your C# class? It may be more of a hassle, but would be supported.
Telligent Systems, Inc. ©2012, All Rights Reserved
Telligent Systems, Inc. ©2013, All Rights Reserved