Skip to main content

Users.GetCurrentUserAsync

Description

Gets the current user's UserInfo details from the connected Control Room.

Signature [C#]

Task<UserInfo> GetCurrentUserAsync()

Properties

Output

PropertyDescription
Task<UserInfo>Returns current user's information.

Remarks

Use GetCurrentUserAsync API to get current user's UserInfo information from the connected Control Room.

Example

C#
public void GetCurrentUser()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");

UserInfo userInfo = Task.Run(() => context.Users.GetCurrentUserAsync()).Result;
System.Console.WriteLine("Username: " + userInfo.UserName);
}
C#
public IControlRoomContext LoginControlRoom()
{
IControlRoomContext context;
string connectionString;

connectionString = "ServerUrl=https://demo.onnitellibuddies.com;UserName=demoadmin;Password=password";
context = new ControlRoomContext(connectionString);

context.Open();
return context;
}