Skip to main content

Connections.CreateConnectionAsync

Description

The API creates a new Connection with the specified details inside the connected Control Room.

Signature [C#]

Task<Connection> CreateConnectionAsync(NewConnection connection);

Properties

Input

PropertyDescription
NewConnectionThe new connection details to be created.

Output

PropertyDescription
Task<Connection>Returns newly created connection.

Remarks

Use CreateConnectionAsync API to create a new Connection inside the connected Control Room.

Example

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

NewConnection connection = new NewConnection()
{
ConnectionType = "File System",
Description = "API test",
Name = "FsConnApiTest",
Value = new ConnectionValue()
{
Value = "{\"folderPath\":\"YourPath\"}"
}
};

var conn = Task.Run(() => context.Connections.CreateConnectionAsync(connection)).Result;
System.Console.WriteLine("Connection Name: " + conn.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;
}