Skip to main content

Bots.CreateBotAsync

Description

Creates a new Assistant Buddy inside the connected Control Room with the provided details

Signature [C#]

Task<BotInfo> CreateBotAsync(NewBotInfo botInfo)

Properties

Input

PropertyDescription
botInfoDetails to create new bot of type NewBotInfo

Output

PropertyDescription
BotInfoReturns newly created bot details.

Remarks

Use the CreateBotAsync API to create a new Bot (Assistant Buddy) inside the connected Control Room.

Example

C#
public void CreateAssistantBuddy()
{
IControlRoomContext context = LoginControlRoom();

NewBotInfo newBotInfo = new NewBotInfo()
{
BotGuid = Guid.NewGuid().ToString("N"),
BotName = "IB-166",
Machine = "IB-166",
MachineKey = "8KL4-2E5E-C4CE-F826-3E79-0F5F-8BF6-B32A",
UserName = "tester",
ExecStatus = 1,
AppId = (int)AppName.AssistantBuddy
};

BotInfo botInfo = Task.Run(() => context.Bots.CreateBotAsync(newBotInfo)).Result;
System.Console.WriteLine("Bot Name is " + botInfo.BotName);
}
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;
}