Doubt with api for creating user

Jamie Sammons, modified 1 Year ago. New Member Post: 1 Join Date: 2/21/24 Recent Posts

  Hi all,

I am trying to create an user from an object action calling headless-admin-user/v1.0/user-accounts. I can create the user sending the fields in the parameter, but the language id for the user is always the default one. Is there any way of specify the language id when create the user? Email than is sent when creation is needed to be sent in the language of the user

Thanks in advance

 

Jamie Sammons, modified 1 Year ago. New Member Posts: 5 Join Date: 2/29/24 Recent Posts

Hi Daniel,
What format do you want the language id in?
If you want it for example as "en_EN" you can use ThemeDisplay.

ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
Locale locale = themeDisplay.getLocale();