Skip to main content

SmartBuddies.CreateSmartBuddyAsync

Description

Creates a new Smart Buddy with specified NewSmartBuddyInfo details inside the connected Control Room.

Signature [C#]

Task<SmartBuddyInfo> CreateSmartBuddyAsync(NewSmartBuddyInfo newSmartBuddyInfo)

Properties

Input

PropertyDescription
NewSmartBuddyInfo newSmartBuddyInfoDetails to create new SmartBuddy.

Output

| Task<SmartBuddyInfo> | Returns newly created SmartBuddy details. | |||

Remarks

Use CreateSmartBuddyAsync API to create new Smart Buddy with specified NewSmartBuddyInfo details inside the connected Control Room.

Example

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

NewSmartBuddyInfo newSmartBuddyInfo = new NewSmartBuddyInfo()
{
UserId = 1,
StationId = 1,
Name = "Test_Buddy",
DomainUser = "INTELLIBUDDIES\ibqa2,
DomainPwd = "Password@123",
Description = "Smart buddy",
IsEnabled = true
};

SmartBuddyInfo smartBuddyInfo = Task.Run(() => context.SmartBuddies.CreateSmartBuddyAsync(newSmartBuddyInfo)).Result;
System.Console.WriteLine("SmartBuddy Name: "+ smartBuddyInfo.Name);
}
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;
}