api icon

Downloading Attachments

Each endpoint accepts an ​:as2_message_id​ path parameter indicating the source AS2 message.

For messages containing multiple attachments, an additional :index path parameter can be provided to specify which attachment to download. The parameter is zero-based; e.g. for a message with 5 attachments, valid values for :index would be 0 through 4. If :index is unspecified, only the first attachment (position 0) will be downloaded.

For all successful responses,

  • the response ​status​ will be HTTP 200 OK

  • the response ​payload​ will be the binary data of the attachment, with Content-Type: application/octet-stream

  • the attachment file name will be available in the ​Content-Disposition ​header: Content-Disposition: attachment; filename=<attachment_name>

Received AS2 Message

GET /:v/message/received/:as2_message_id/attachments

GET /:v/message/received/:as2_message_id/attachments/:index

Sent AS2 Message

GET /:v/message/sent/:as2_message_id/attachments

GET /:v/message/sent/:as2_message_id/attachments/:index

Downloading Multiple Attachments

Single AS2 Message

GET /:v/message/received/:as2_message_id/attachments/all
GET /:v/message/sent/:as2_message_id/attachments/all

Multiple AS2 Messages (Batch Download)

POST /:v/message/received/batch/attachments

Submit the message IDs whose attachments you want to download (up to 100), as a JSON array in the request body:

POST /:v/message/received/batch/attachments
Authorization​: <token_string>
Content-Type​: application/json

["message-id-1","message-id-2",...]

You can also pass in a markAsRead query parameter to automatically mark these messages as read, after downloading their attachments.

The response payload will be a zip archive (Content-Type: application/octet-stream) containing attachments of each message under a folder named after the respective message ID:

<zip archive>
|
|__message-id-1/
|  |
|  |__attachment-1-1
|  |__attachment-1-2
|
|__message-id-2/
|  |
|  |__attachment-2-1
|  |__attachment-2-2
...
If the API failed to find attachments for any provided message ID, the corresponding folder inside the archive will contain a .error file with the respective error message.

If the total size of aggregated attachments exceeds 10 MB, the API will stop the aggregation, and return the set of attachments aggregated so far, as the zip content. In this case, the response HTTP code will be 206 Partial Content (instead of the usual 200), and the zero-based index of the last successfully added attachment will be indicated in an X-Batch-Truncation-Index HTTP response header. For example, if the size limit was reached after adding the 3rd attachment (index 2) of the 2nd message (index 1), the header would be:

X-Batch-Truncation-Index: (1,2)

Also in this case, if markAsRead flag is set, only the fully-archived messages would be marked as read; in above example, only message-id-1 would be marked, because message-id-2 was only partially downloaded.

Downloading MDNs

Endpoint specification is the same as ​attachment download​.

Received AS2 Message

GET /:v/message/received/:as2_message_id/mdn

Sent AS2 Message

GET /:v/message/sent/:as2_message_id/mdn
In this topic
In this topic