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

as2_incoming_message.List()

Return Values

Returns a *as2_incoming_message.Iter and an error. Range over All() to receive files_sdk.As2IncomingMessage values and errors. Check each loop error before using its resource. Next() and Err() remain supported.

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 (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    as2_incoming_message "github.com/Files-com/files-sdk-go/v3/as2incomingmessage"
)

as2IncomingMessageIterator, err := as2_incoming_message.List(files_sdk.As2IncomingMessageListParams{})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}

for as2IncomingMessage, err := range as2IncomingMessageIterator.All() {
    if err != nil {
        var respErr files_sdk.ResponseError
        if errors.As(err, &respErr) {
            fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
        } else {
            fmt.Printf("Request failed: %v\n", err)
        }
        return
    }
    fmt.Println(as2IncomingMessage)
}

Show AS2 Incoming Message

SDK Method

as2_incoming_message.Find()

Return Values

Returns a files_sdk.As2IncomingMessage value and an error.

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.

As2IncomingMessageFindParams Fields

FieldDescription
Id
int64
Required
As2 Incoming Message ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    as2_incoming_message "github.com/Files-com/files-sdk-go/v3/as2incomingmessage"
)

as2IncomingMessage, err := as2_incoming_message.Find(files_sdk.As2IncomingMessageFindParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}
fmt.Println(as2IncomingMessage)

Replay AS2 Incoming Message

SDK Method

as2_incoming_message.Replay()

Return Values

Returns a files_sdk.As2IncomingMessage value and an error.

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.

As2IncomingMessageReplayParams Fields

FieldDescription
Id
int64
Required
As2 Incoming Message ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    as2_incoming_message "github.com/Files-com/files-sdk-go/v3/as2incomingmessage"
)

as2IncomingMessage, err := as2_incoming_message.Replay(files_sdk.As2IncomingMessageReplayParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}
fmt.Println(as2IncomingMessage)

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.
ReplayedFromMessageId
int64
ID of the incoming message record this message was replayed from. Empty for messages received directly from a trading partner.
WorkspaceId
int64
ID of the Workspace associated with this AS2 Incoming Message.
As2PartnerId
int64
Id of the AS2 Partner associated with this message.
As2StationId
int64
Id of the AS2 Station associated with this message.
Uuid
string
UUID assigned to this message.
ContentType
string
Content Type header of the incoming message.
HttpHeaders
object
HTTP Headers sent with this message.
ProcessingResult
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
ProcessingResultDescription
string
Result of processing description.
Mic
string
AS2 Message Integrity Check
MicAlgo
string
AS2 Message Integrity Check Algorithm Used
As2To
string
AS2 TO header of message
As2From
string
AS2 FROM header of message
MessageId
string
AS2 Message Id
Subject
string
AS2 Subject Header
Date
string
Date Header
BodySize
string
Encrypted Payload Body Size
AttachmentFilename
string
Filename of the file being received.
Ip
string
IP Address of the Sender
CreatedAt
date-time
Message creation date/time
HttpResponseCode
string
HTTP Response Code sent for this message
HttpResponseHeaders
object
HTTP Headers sent for this message.
RecipientSerial
string
Incoming Message Recipient(the Client Cert used to encrypt this message)'s serial
HexRecipientSerial
string
Incoming Message Recipient(the Client Cert used to encrypt this message)'s serial in hex format.
RecipientIssuer
string
Incoming Message Recipient(the Client Cert used to encrypt this message)'s issuer
MessageReceived
boolean
Message body received?
MessageDecrypted
boolean
Message decrypted successfully?
MessageSignatureVerified
boolean
Message signature verified?
MessageProcessingSuccess
boolean
Message processed successfully?
MessageMdnReturned
boolean
MDN returned?
EncryptedUri
string
URL to download the encrypted signed smime that is to sent as AS2 body
SmimeSignedUri
string
URL to download the file contents as smime with signature
SmimeUri
string
URL to download the file contents encoded as smime
RawUri
string
URL to download the original file contents
MdnResponseUri
string
URL to download the http response body