Hello,
I'm creating an user via .NET SDK (boxClient.Users.CreateUserAsync method) but user is being created with different email address. In the body request I'm setting email as <personal information-redacted> but in the result I'm getting something like "AppUser_2317968_daP2ZOIUIW@boxdeveditition.com". How I can create user with proper email address?
Best regards,
Damian Kochmański
Hello @Visario,
It looks like when you use the .CreateUserAsync
method with boxClient
, the email returned is not the one you set, but a generated one like "AppUser_2317968_daP2ZOIUIW@boxdeveditition.com". This is because the Box platform assigns unique email addresses to App Users. Unfortunately, App Users cannot be created with custom email addresses directly as they are designed for system use rather than for use as primary email contacts.
If you need users to have custom email addresses, you might consider creating Managed Users instead, which allows you to assign your specified email addresses. Here's a quick example:
csharp
var userRequest = new BoxUserRequest
{
Name = "John Doe",
IsPlatformAccessOnly = false, // Set this to false to create a Managed User
Login = "custom.email@example.com"
};
BoxUser user = await boxClient.UsersManager.CreateEnterpriseUserAsync(userRequest);
This will allow you to assign your custom email addresses to users.
Hope this helps!
Best Regards,
Joan Martin