Skip to main content

SmartBuddies.GetSmartBuddyByNameAsync

Description

Gets the SmartBuddyInfo with the specified Smart Buddy name from the connected Control Room.

Signature [C#]

Task<SmartBuddyInfo> GetSmartBuddyByNameAsync(string buddyName)

Properties

Input

PropertyDescription
buddyNameSpecify the buddy name for which the Smart Buddy information has to be retrieved.

Output

| Task<SmartBuddyInfo> | Returns the information of a smart buddy by using its Id. | |||

Remarks

Use GetSmartBuddyByNameAsync API to get the SmartBuddyInfo details with specified Smart Buddy name from the connected Control Room.

Example

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

string buddyName = "APITest_Buddy";

SmartBuddyInfo smartBuddy = Task.Run(() => context.SmartBuddies.GetSmartBuddyByNameAsync(buddyName)).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;
}