Skip to main content
Version: Current

Connections.GetConnectionDataAsync

Description​

Gets the specified connection from the connected AI Command Center

Signature [C#]​

Task<ConnectionData> GetConnectionDataAsync(int connectionId);

Properties​

Input​

ParameterTypeRequired / defaultDescription
connectionIdintRequiredSpecify the id of the connection to be retrieved.

Output​

PropertyDescription
Task<ConnectionData>Returns the details of the specified connection.

Remarks​

Use GetConnectionDataAsync API to get information about the connection from the connected AI Command Center.

Example​

C#
public async Task GetConnectionData()
{
IControlRoomContext context = LoginControlRoom();
try
{
int connectionId = 3;
var connection = await context.Connections.GetConnectionDataAsync(connectionId);
Console.WriteLine("Connection Value: " + connection.Value);
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}

See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.