AS2 Partners

An AS2Partner is a counterparty of the Files.com site's AS2 connectivity. Generally you will have one AS2 Partner created for each counterparty with whom you send and/or receive files via AS2.

List AS2 Partners

SDK Method

Files::As2Partner.list

Return Object

List<As2Partner>

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_partners = Files::As2Partner.list
  as2_partners.auto_paging_each do |as2_partner|
    # Operate on as2_partner
  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 Partner

SDK Method

Files::As2Partner.find

Return Object

As2Partner

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 Partner ID.

Example Request

begin
  as2_partner = Files::As2Partner.find(id)
  # Operate on as2_partner
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 Partner

SDK Method

Files::As2Partner.create

Return Object

As2Partner

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
enable_dedicated_ips
boolean
falseIf true, we will use your site's dedicated IPs for all outbound connections to this AS2 Partner.
http_auth_username
string
Username to send to server for HTTP Authentication.
http_auth_password
string
Password to send to server for HTTP Authentication.
mdn_validation_level
string
"auto"How should Files.com evaluate message transfer success based on a partner's MDN response? This setting does not affect MDN storage; all MDNs received from a partner are always stored. none: MDN is stored for informational purposes only, a successful HTTPS transfer is a successful AS2 transfer. weak: Inspect the MDN for MIC and Disposition only. normal: weak plus validate MDN signature matches body, strict: normal but do not allow signatures from self-signed or incorrectly purposed certificates. auto: Automatically set the correct value for this setting based on next mdn received.
Possible values: none, weak, normal, strict, auto
signature_validation_level
string
"auto"Should Files.com require signatures on incoming AS2 messages? normal: require that incoming messages are signed with a valid matching signature. none: Unsigned incoming messages are allowed. auto: Automatically set the correct value for this setting based on next message received.
Possible values: normal, none, auto
server_certificate
string
"require_match"Should we require that the remote HTTP server have a valid SSL Certificate for HTTPS? (This only applies to Outgoing AS2 message from Files.com to a Partner.)
Possible values: require_match, allow_any
default_mime_type
string
Default mime type of the file attached to the encrypted message
additional_http_headers
object
Additional HTTP Headers for outgoing message sent to this partner.
as2_station_id
int64
Required
ID of the AS2 Station associated with this partner.
name
string
Required
The partner's formal AS2 name.
uri
string
Required
Public URI where we will send the AS2 messages (via HTTP/HTTPS).
public_certificate
string
Required
Public certificate for AS2 Partner. Note: This is the certificate for AS2 message security, not a certificate used for HTTPS authentication.

Example Request

begin
  as2_partner = Files::As2Partner.create(
    as2_station_id: 1,
    name: "AS2 Partner Name",
    uri: "example",
    public_certificate: "public_certificate"
  )
  # Operate on as2_partner
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 Partner

SDK Method

as2_partner.update

Return Object

As2Partner

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
enable_dedicated_ips
boolean
If true, we will use your site's dedicated IPs for all outbound connections to this AS2 Partner.
http_auth_username
string
Username to send to server for HTTP Authentication.
http_auth_password
string
Password to send to server for HTTP Authentication.
mdn_validation_level
string
How should Files.com evaluate message transfer success based on a partner's MDN response? This setting does not affect MDN storage; all MDNs received from a partner are always stored. none: MDN is stored for informational purposes only, a successful HTTPS transfer is a successful AS2 transfer. weak: Inspect the MDN for MIC and Disposition only. normal: weak plus validate MDN signature matches body, strict: normal but do not allow signatures from self-signed or incorrectly purposed certificates. auto: Automatically set the correct value for this setting based on next mdn received.
Possible values: none, weak, normal, strict, auto
signature_validation_level
string
Should Files.com require signatures on incoming AS2 messages? normal: require that incoming messages are signed with a valid matching signature. none: Unsigned incoming messages are allowed. auto: Automatically set the correct value for this setting based on next message received.
Possible values: normal, none, auto
server_certificate
string
Should we require that the remote HTTP server have a valid SSL Certificate for HTTPS? (This only applies to Outgoing AS2 message from Files.com to a Partner.)
Possible values: require_match, allow_any
default_mime_type
string
Default mime type of the file attached to the encrypted message
additional_http_headers
object
Additional HTTP Headers for outgoing message sent to this partner.
name
string
The partner's formal AS2 name.
uri
string
Public URI where we will send the AS2 messages (via HTTP/HTTPS).
public_certificate
string
Public certificate for AS2 Partner. Note: This is the certificate for AS2 message security, not a certificate used for HTTPS authentication.

Example Request

begin
  # Find the as2_partner object by its id.
  as2_partner = Files::As2Partner.find(id)
  as2_partner.update(
    enable_dedicated_ips: true
  )
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 Partner

SDK Method

as2_partner.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_partner object by its id.
  as2_partner = Files::As2Partner.find(id)
  as2_partner.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 As2Partner Object

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

AttributeDescription
id
int64
ID of the AS2 Partner.
workspace_id
int64
ID of the Workspace associated with this AS2 Partner.
as2_station_id
int64
ID of the AS2 Station associated with this partner.
name
string
The partner's formal AS2 name.
uri
string
Public URI where we will send the AS2 messages (via HTTP/HTTPS).
server_certificate
string
Should we require that the remote HTTP server have a valid SSL Certificate for HTTPS? (This only applies to Outgoing AS2 message from Files.com to a Partner.)
Possible values: require_match, allow_any
http_auth_username
string
Username to send to server for HTTP Authentication.
additional_http_headers
object
Additional HTTP Headers for outgoing message sent to this partner.
default_mime_type
string
Default mime type of the file attached to the encrypted message
mdn_validation_level
string
How should Files.com evaluate message transfer success based on a partner's MDN response? This setting does not affect MDN storage; all MDNs received from a partner are always stored. none: MDN is stored for informational purposes only, a successful HTTPS transfer is a successful AS2 transfer. weak: Inspect the MDN for MIC and Disposition only. normal: weak plus validate MDN signature matches body, strict: normal but do not allow signatures from self-signed or incorrectly purposed certificates. auto: Automatically set the correct value for this setting based on next mdn received.
Possible values: none, weak, normal, strict, auto
signature_validation_level
string
Should Files.com require signatures on incoming AS2 messages? normal: require that incoming messages are signed with a valid matching signature. none: Unsigned incoming messages are allowed. auto: Automatically set the correct value for this setting based on next message received.
Possible values: normal, none, auto
enable_dedicated_ips
boolean
If true, we will use your site's dedicated IPs for all outbound connections to this AS2 Partner.
hex_public_certificate_serial
string
Serial of public certificate used for message security in hex format.
public_certificate
string
Public certificate used for message security.
public_certificate_md5
string
MD5 hash of public certificate 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.