Users.UpdateUserInfoAsync
Description
Updates the specified UserInfo details inside the connected AI Command Center.
Signature [C#]
Task UpdateUserInfoAsync(UserInfo userInfo);
Properties
Input
| Parameter | Type | Required / default | Description |
|---|---|---|---|
userInfo | UserInfo | Required | Specify the update detail of a user. |
Remarks
Use UpdateUserInfoAsync API to update specified User information inside the AI Command Center .
Example
C#
public async Task UpdateUserInfo()
{
IControlRoomContext context = LoginControlRoom();
try
{
string updateUserName = "updateUser";
string updateFirstName = "updateTest";
string updateLastName = "updateUser";
List<Role> roles = new List<Role>();
Role role = new Role();
role.RoleId = 1;
roles.Add(role);
UserInfo userInfo = new UserInfo()
{
UserId = 1,
UserName = updateUserName,
FirstName = updateFirstName,
LastName = updateLastName,
EmailAddress = "ibqa@vitinfotech.com",
isEnabled = true,
roles = roles,
};
await context.Users.UpdateUserInfoAsync(userInfo);
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}
See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.