Picture of Timo 5221
Registered 4 years 61 days
Timo 5221 Thursday, 29 July 2021, 12:08 PM
Insert Avatar Images
We have the customer request to read out avatar images from the active directory and assign them to the pbx users as profile images. According to the SDK description, the com.innovaphone.avatar API can be used to read the avatar images. How can we insert this?
Picture of Carmen Álvarez Méndez (innovaphone)
Moderator Registered 7 years 85 days
Carmen Álvarez Méndez (innovaphone) Friday, 30 July 2021, 12:37 PM
Re: Insert Avatar Images
Hi Timo,

You can use the Services API for the authentication for the websocket connection to Users:
https://sdk.innovaphone.com/doc/appwebsocket/Services.htm

Then you can send UserData to get the IDs of every user (with % as filter you will receive the first 100 Users, to get the next 100 you must send the same message but with 100 as offset):

{"mt":"NumUsersResult","src":"usersadmin","numUsers":261,"maxID":18548625}
{"mt":"NumUsersResult","src":"usersadmin","numUsers":261,"maxID":18548625}

{"mt":"UserData","maxID":18548625,"offset":0,"filter":"%","update":false,"col":"id","asc":true,"src":"usersadmin"}
{"mt":"UserDataInfo","src":"usersadmin","id":"32","username":"atlantis","dn":"","cn":"Atlantis"}
...
{"mt":"UserDataResult","src":"usersadmin","result":"ok"}

Then you can use SetPicture to set the profile picture (small, medium and large on base64) for every user:
{ "mt":"SetPicture", "src":"test", "ids":[{32}],"data":"small","picture":"data:image/jpeg;base64,/9j/4AAQ..." }
{ "mt":"SetPictureResult" }

{ "mt":"SetPicture", "src":"test", "ids":[{32}],"data":"medium","picture":"data:image/jpeg;base64,/9j/4AAQ..." }
{ "mt":"SetPictureResult" }

{ "mt":"SetPicture", "src":"test", "ids":[{32}],"data":"large","picture":"data:image/jpeg;base64,/9j/4AAQ..." }
{ "mt":"SetPictureResult" }

Regards,
Carmen



Picture of Timo 5221
Registered 4 years 61 days
Timo 5221 Monday, 2 August 2021, 12:24 PM
Re: Insert Avatar Images
Hi Carmen,

Thanks for the detailed answer. I think that I first have to implement a corresponding AppService in order to then import the data from an external source via a script. I hope that I am correct if I use the basic principle from the tutorial https://sdk.innovaphone.com/doc/tutorials/RCCfromExternalWebPage.htm as a starting point.

Regards,
Timo
← You can define your color theme preference here