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 Method

Files::As2Station.list

Return Object

List<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

begin
  as2_stations = Files::As2Station.list
  as2_stations.auto_paging_each do |as2_station|
    # Operate on as2_station
  end
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

Show AS2 Station

SDK Method

Files::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.

Method Arguments

ArgumentDescription
id
int64
Required
As2 Station ID.

Example Request

begin
  as2_station = Files::As2Station.find(id)
  # Operate on as2_station
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

Create AS2 Station

SDK Method

Files::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.

Method 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

begin
  as2_station = Files::As2Station.create(
    name: "AS2 Station Name",
    public_certificate: "public_certificate",
    private_key: "private_key"
  )
  # Operate on as2_station
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

Update AS2 Station

SDK Method

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

Method Arguments

ArgumentDescription
name
string
The station's formal AS2 name.
public_certificate
string
private_key
string
private_key_password
string

Example Request

begin
  # Find the as2_station object by its id.
  as2_station = Files::As2Station.find(id)
  as2_station.update(
    name: "AS2 Station Name"
  )
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

Delete AS2 Station

SDK Method

as2_station.delete

Return Object

nil

Authorization Requirement

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

Example Request

begin
  # Find the as2_station object by its id.
  as2_station = Files::As2Station.find(id)
  as2_station.delete
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

The As2Station Object

Some of the methods 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.