Skip to main content

SmartBuddies.GetSmartBuddyByIdAsync

Description

Gets SmartBuddyInfo with specified Buddy Id from the connected Control Room.

Signature [C#]

Task<SmartBuddyInfo> GetSmartBuddyByIdAsync(int buddyId)

Properties

Input

PropertyDescription
botIdSpecify the buddy Id for which the Smart Buddy information has to be retrieved.

Output

| Task<SmartBuddyInfo> | Returns the information of a Smart Buddy using its Id. | |||

Remarks

Use GetSmartBuddyByIdAsync API to get SmartBuddyInfo details with specified buddy Id from the connected Control Room.

Example

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

int buddyId = 1;

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