AS2 Incoming Messages

An AS2IncomingMessage is a single record created for each individual AS2 file transfer incoming from a Partner. It contains the message details and tracks the lifecycle status with milestones of the transfer.

Replaying a retained message creates a new incoming message. Its replayed_from_message_id identifies the incoming-message record that was replayed. The original AS2 message_id is preserved. The source record ID remains available after that record is removed by message retention.

List AS2 Incoming Messages

SDK Method

\Files\Model\As2IncomingMessage::list;

Return Object

As2IncomingMessage[]

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

try {
  $as2_incoming_messages = \Files\Model\As2IncomingMessage::list();
  foreach ($as2_incoming_messages as $as2_incoming_message) {
    // Operate on $as2_incoming_message
  }
} catch (\Files\Exception\NotAuthenticatedException $e) {
  echo 'Authentication Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
} catch (\Files\Exception\FilesException $e) {
  echo 'Unknown Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
}

Show AS2 Incoming Message

SDK Method

\Files\Model\As2IncomingMessage::find;

Return Object

As2IncomingMessage

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
As2 Incoming Message ID.

Example Request

try {
  $as2_incoming_message = \Files\Model\As2IncomingMessage::find($id);
  // Operate on $as2_incoming_message
} catch (\Files\Exception\NotAuthenticatedException $e) {
  echo 'Authentication Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
} catch (\Files\Exception\FilesException $e) {
  echo 'Unknown Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
}

Replay AS2 Incoming Message

SDK Method

$as2_incoming_message->replay;

Return Object

As2IncomingMessage

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

try {
  // Find the as2_incoming_message object by its id.
  $as2_incoming_message = \Files\Model\As2IncomingMessage::find(id);
  $as2_incoming_message->replay();
} catch (\Files\Exception\NotAuthenticatedException $e) {
  echo 'Authentication Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
} catch (\Files\Exception\FilesException $e) {
  echo 'Unknown Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
}

The As2IncomingMessage Object

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

AttributeDescription
id
int64
ID of this AS2 incoming message record.
replayed_from_message_id
int64
ID of the incoming message record this message was replayed from. Empty for messages received directly from a trading partner.
workspace_id
int64
ID of the Workspace associated with this AS2 Incoming Message.
as2_partner_id
int64
Id of the AS2 Partner associated with this message.
as2_station_id
int64
Id of the AS2 Station associated with this message.
uuid
string
UUID assigned to this message.
content_type
string
Content Type header of the incoming message.
http_headers
object
HTTP Headers sent with this message.
processing_result
string
Result of processing.
Possible values: not_started, unable_to_find_station, unable_to_find_partner, unable_to_validate_signature, decrypt_fail, file_save_fail, success
processing_result_description
string
Result of processing description.
mic
string
AS2 Message Integrity Check
mic_algo
string
AS2 Message Integrity Check Algorithm Used
as2_to
string
AS2 TO header of message
as2_from
string
AS2 FROM header of message
message_id
string
AS2 Message Id
subject
string
AS2 Subject Header
date
string
Date Header
body_size
string
Encrypted Payload Body Size
attachment_filename
string
Filename of the file being received.
ip
string
IP Address of the Sender
created_at
date-time
Message creation date/time
http_response_code
string
HTTP Response Code sent for this message
http_response_headers
object
HTTP Headers sent for this message.
recipient_serial
string
Incoming Message Recipient(the Client Cert used to encrypt this message)'s serial
hex_recipient_serial
string
Incoming Message Recipient(the Client Cert used to encrypt this message)'s serial in hex format.
recipient_issuer
string
Incoming Message Recipient(the Client Cert used to encrypt this message)'s issuer
message_received
boolean
Message body received?
message_decrypted
boolean
Message decrypted successfully?
message_signature_verified
boolean
Message signature verified?
message_processing_success
boolean
Message processed successfully?
message_mdn_returned
boolean
MDN returned?
encrypted_uri
string
URL to download the encrypted signed smime that is to sent as AS2 body
smime_signed_uri
string
URL to download the file contents as smime with signature
smime_uri
string
URL to download the file contents encoded as smime
raw_uri
string
URL to download the original file contents
mdn_response_uri
string
URL to download the http response body