AS2 Stations

An AS2Station is a remote AS2 server that can send data into Files.com and receive data from Files.com.

List AS2 Stations

SDK Function

As2Station.list()

Return Object

ListIterator<As2Station>

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

import com.files.ListIterator;
import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.As2Station;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  ListIterator<As2Station> as2Stations = As2Station.list(parameters);
  for (As2Station as2Station : as2Stations.listAutoPaging()) {
    // Operate on as2Station
  }
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Show AS2 Station

SDK Function

As2Station.find()

Return Object

As2Station

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Function Arguments

ArgumentDescription
id
int64
Required
As2 Station ID.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.As2Station;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  As2Station as2Station = As2Station.find(id, parameters);
  // Operate on as2Station
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Create AS2 Station

SDK Function

As2Station.create()

Return Object

As2Station

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Function Arguments

ArgumentDefaultDescription
name
string
Required
The station's formal AS2 name.
workspace_id
int64
0ID of the Workspace associated with this AS2 Station.
public_certificate
string
Required
private_key
string
Required
private_key_password
string

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.As2Station;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("name", "AS2 Station Name");
  parameters.put("public_certificate", "public_certificate");
  parameters.put("private_key", "private_key");
  
  As2Station as2Station = As2Station.create(parameters);
  // Operate on as2Station
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Update AS2 Station

SDK Function

as2Station.update();

Return Object

As2Station

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Attribute Setters

SetterDescription
setName
string
The station's formal AS2 name.
setPublicCertificate
string
setPrivateKey
string
setPrivateKeyPassword
string

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.As2Station;

try {
  // Find the as2Station object by its id.
  As2Station as2Station = As2Station.find(id, null);
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("name", "AS2 Station Name");
  as2Station.update(parameters);
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Delete AS2 Station

SDK Function

as2Station.delete();

Return Object

No return value.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.As2Station;

try {
  // Find the as2Station object by its id.
  As2Station as2Station = As2Station.find(id, null);
  as2Station.delete(null);
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

The As2Station Object

Some of the functions above return a As2Station object. The attributes of this object are listed below.

AttributeDescription
id
int64
Id of the AS2 Station.
workspace_id
int64
ID of the Workspace associated with this AS2 Station.
name
string
The station's formal AS2 name.
uri
string
Public URI for sending AS2 message to.
domain
string
The station's AS2 domain name.
hex_public_certificate_serial
string
Serial of public certificate used for message security in hex format.
public_certificate_md5
string
MD5 hash of public certificate used for message security.
public_certificate
string
Public certificate used for message security.
private_key_md5
string
MD5 hash of private key used for message security.
public_certificate_subject
string
Subject of public certificate used for message security.
public_certificate_issuer
string
Issuer of public certificate used for message security.
public_certificate_serial
string
Serial of public certificate used for message security.
public_certificate_not_before
string
Not before value of public certificate used for message security.
public_certificate_not_after
string
Not after value of public certificate used for message security.
private_key_password_md5
string
MD5 hash of private key password used for message security.