Connections.TestConnectionAsync
Description
The API Tests a new Connection with the specified details inside the connected Control Room.
Signature [C#]
Task<string> TestConnectionAsync(NewConnection connection);
Properties
Input
Property | Description |
---|---|
NewConnection | The new connection details to be Testd. |
Output
Property | Description |
---|---|
Task<string> | Returns the status as a string. |
Remarks
Use TestConnectionAsync API to Test a new Connection inside the connected Control Room.
Example
C#
public void TestConnection()
{
IControlRoomContext context = LoginControlRoom();
NewConnection connection = new NewConnection()
{
ConnectionType = "Email Server",
Description = "API test",
Name = "olConnApiTest",
Value = new EmailServerConnectionValue()
{
ServerType = "Outlook",
ClientId = "Your outlook client id",
TenantId = "Your outlook tenant id",
ClientSecret = "Your outlook client secret",
EmailAddress = "demo@domain.com",
MailFolder = "Inbox"
}
};
var status = Task.Run(() => context.Connections.TestConnectionAsync(connection)).Result;
System.Console.WriteLine("Status: " + status);
}
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;
}