Skip to content

Download an attachment

GET
/mail/mailboxes/{mailbox}/messages/{messageId}/parts/{part}/content
curl --request GET \
--url 'https://mail.work.optidata.cloud/api/mail/mailboxes/78/messages/4186/parts/2/content?signature=example'

Stream one attachment of a message. This endpoint takes no bearer token: it is authorised by the signature in the query string, which the reader endpoints already embed in each attachment’s url. Read that url and use it as-is rather than assembling one yourself — the signature is bound to the exact mailbox, message and part.

mailbox
required
integer

Id of the mailbox. Every mailbox the caller may use is listed in their account.

messageId
required
string

Id of the message.

part
required
string

The MIME part number, from the attachment’s part field.

signature
required
string

The signature issued with the attachment’s url.

The attachment content.

Media typeapplication/octet-stream
string format: binary

The signature is missing.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplemissing
{
"message": "Missing signature"
}

The signature is invalid, or does not match this mailbox, message and part.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examplegenerated
{
"message": "example"
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}

The mail platform did not answer as expected — a folder or message that does not exist, or a transient failure. reference is the code to quote to support and fault_code names the underlying condition. A 503 with the same envelope means the platform is in maintenance; retry shortly.

Media typeapplication/json

Failure raised by the mail platform behind the API rather than by the request itself.

object
error
required

What went wrong, phrased for the end user.

string
status
required

Repeats the HTTP status code.

integer
help
required

Suggested next step.

string
reference
required

Support reference, e.g. MZ-502.

string
fault_code

Names the underlying condition, e.g. mail.NO_SUCH_FOLDER.

string | null
Examples

Unknown folder

{
"error": "The mail server did not answer as expected, so this action could not be completed.",
"status": 502,
"help": "If the problem persists, contact support and inform the error code above.",
"reference": "MZ-502",
"fault_code": "mail.NO_SUCH_FOLDER"
}