Application Connections

List Application Connections

SDK Method

ApplicationConnection.List();

Return Object

FilesList<ApplicationConnection>

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Additional Arguments

Example Request

using FilesCom.Models;

try
{
    var applicationConnectionIterator = ApplicationConnection.List();
    await foreach (ApplicationConnection applicationConnection in applicationConnectionIterator.ListAutoPagingAsync()) {
        // Operate on applicationConnection
    }
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

Show Application Connection

SDK Method

ApplicationConnection.Find();

Return Object

ApplicationConnection

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Method Arguments

ArgumentDescription
id
int64
Required
Application Connection ID.

Example Request

using FilesCom.Models;

try
{
    var applicationConnection = await ApplicationConnection.Find(1L);
    // Operate on applicationConnection
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

Create Application Connection

SDK Method

ApplicationConnection.Create();

Return Object

ApplicationConnection

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Method Arguments

ArgumentDefaultDescription
name
string
Required
Connection display name.
secret_id
int64
ID of the credential in the Secret Store, if the connection uses a credential.
application_key
string
Required
Application key from the Automation applications list.
origin
string
Required
HTTPS origin for this connection.
workspace_id
int64
0Workspace that owns this connection.

Example Request

using FilesCom.Models;

var parameters = new Dictionary<string, object>();
parameters.Add("name", "example");
parameters.Add("application_key", "example");
parameters.Add("origin", "example");

try
{
    var applicationConnection = await ApplicationConnection.Create(parameters);
    // Operate on applicationConnection
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

Update Application Connection

SDK Method

applicationConnection.Update();

Return Object

ApplicationConnection

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Method Arguments

ArgumentDescription
name
string
Connection display name.
secret_id
int64
ID of the credential in the Secret Store, if the connection uses a credential.

Example Request

using FilesCom.Models;

var parameters = new Dictionary<string, object>();
parameters.Add("name", "example");

try
{
    // Find the applicationConnection object by its id.
    var applicationConnection = await ApplicationConnection.Find(1L);
    await applicationConnection.Update(parameters);
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

Delete Application Connection

SDK Method

applicationConnection.Delete();

Return Object

No return value.

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Example Request

using FilesCom.Models;

var parameters = new Dictionary<string, object>();

try
{
    // Find the applicationConnection object by its id.
    var applicationConnection = await ApplicationConnection.Find(1L);
    await applicationConnection.Delete(parameters);
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

The ApplicationConnection Object

Some of the methods above return a ApplicationConnection object. The attributes of this object are listed below.

AttributeDescription
id
int64
Connection ID.
workspace_id
int64
Workspace that owns this connection.
name
string
Connection display name.
application_key
string
Application key from the Automation applications list.
origin
string
HTTPS origin for this connection.
secret_id
int64
ID of the credential in the Secret Store, if the connection uses a credential.
authentication
object
Current credential type and placement, without the secret value.
created_at
date-time
Time the connection was created.
updated_at
date-time
Time the connection was updated.