Application Connections

List Application Connections

SDK Method

files_sdk.application_connection.list()

Return Object

ListObj[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

import files_sdk

try:
  application_connections = files_sdk.application_connection.list()
  for application_connection in application_connections.auto_paging_iter():
    print(application_connection.get_attributes())
except files_sdk.error.NotAuthenticatedError as err:
  print(f"Authentication Error Occurred ({type(err).__name__}):", err)
except files_sdk.error.Error as err:
  print(f"Unknown Error Occurred ({type(err).__name__}):", err)

Show Application Connection

SDK Method

files_sdk.application_connection.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

import files_sdk

try:
  application_connection = files_sdk.application_connection.find(id)
  # Operate on application_connection
except files_sdk.error.NotAuthenticatedError as err:
  print(f"Authentication Error Occurred ({type(err).__name__}):", err)
except files_sdk.error.Error as err:
  print(f"Unknown Error Occurred ({type(err).__name__}):", err)

Create Application Connection

SDK Method

files_sdk.application_connection.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

import files_sdk

try:
  application_connection = files_sdk.application_connection.create({
    "name": "example",
    "application_key": "example",
    "origin": "example"
  })
  # Operate on application_connection
except files_sdk.error.NotAuthenticatedError as err:
  print(f"Authentication Error Occurred ({type(err).__name__}):", err)
except files_sdk.error.Error as err:
  print(f"Unknown Error Occurred ({type(err).__name__}):", err)

Update Application Connection

SDK Method

application_connection.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

import files_sdk

try:
  # Find the application_connection object by its id.
  application_connection = files_sdk.application_connection.find(id)
  application_connection.update({
    "name": "example"
  })
except files_sdk.error.NotAuthenticatedError as err:
  print(f"Authentication Error Occurred ({type(err).__name__}):", err)
except files_sdk.error.Error as err:
  print(f"Unknown Error Occurred ({type(err).__name__}):", err)

Delete Application Connection

SDK Method

application_connection.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

import files_sdk

try:
  # Find the application_connection object by its id.
  application_connection = files_sdk.application_connection.find(id)
  application_connection.delete()
except files_sdk.error.NotAuthenticatedError as err:
  print(f"Authentication Error Occurred ({type(err).__name__}):", err)
except files_sdk.error.Error as err:
  print(f"Unknown Error Occurred ({type(err).__name__}):", err)

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.