Skip to main content

Bots.GetBotByIdAsync

Description

Gets an Assistant Buddy with the specified Id

Signature [C#]

Task<BotInfo> GetBotByIdAsync (int botId)

Properties

Input

PropertyDescription
botIdSpecify the Id of the Assistant Buddy to retrive whose information.

Output

PropertyDescription
BotInfoReturns the information of the specified Assistant Buddy

Remarks

Use GetBotByIdAsync API to return information about the specified Assistant Buddy from the connected Control Room.

Example

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

int botId = 1;

BotInfo botInfo = Task.Run(() => context.Bots.GetBotByIdAsync(botId)).Result;
Console.WriteLine("BotName: " + 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;
}