List a message's attachments
GET
/api/v1/mailbox/messages/{message_id}/attachmentsErrors
| Status | When |
|---|---|
401 |
No token, or the session expired or was signed out. Sign in again with POST /mailbox-auth/login. |
403 |
The account has a temporary password: until POST /security/password succeeds, every other call answers this with error_code: password_change_required. |
404 |
Message not found. |
Parameters
| Name | In | Type | Description |
|---|---|---|---|
message_idrequired | path | string |
Request
GET
/api/v1/mailbox/messages/{message_id}/attachmentscurl -X GET 'https://courier.mailyte.com/api/v1/mailbox/messages/01JBT8XQ2M9WYC3K4F6R7S8T9V/attachments' \
-H 'Authorization: Bearer MAILBOX_TOKEN'const response = await fetch('https://courier.mailyte.com/api/v1/mailbox/messages/01JBT8XQ2M9WYC3K4F6R7S8T9V/attachments', {
method: 'GET',
headers: {
Authorization: 'Bearer MAILBOX_TOKEN',
},
});
const { data } = await response.json();import requests
response = requests.get(
"https://courier.mailyte.com/api/v1/mailbox/messages/01JBT8XQ2M9WYC3K4F6R7S8T9V/attachments",
headers={"Authorization": "Bearer MAILBOX_TOKEN"},
)
data = response.json()["data"]<?php
$response = Http::withToken('MAILBOX_TOKEN')
->get('https://courier.mailyte.com/api/v1/mailbox/messages/01JBT8XQ2M9WYC3K4F6R7S8T9V/attachments');
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://courier.mailyte.com/api/v1/mailbox/messages/01JBT8XQ2M9WYC3K4F6R7S8T9V/attachments")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer MAILBOX_TOKEN"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
Successful Response
dataarray<object>indexintegerPosition in the message; pass it to the attachment download.
namestringtypestringMIME type, e.g.
application/pdf.sizeintegerBytes.
is_inlinebooleanAn image shown inside the body (a
cid:reference) rather than a file.content_idstring or nullThe
cid:the body refers to, for inline images.
200
application/json{
"type": "success",
"msg": "Attachments retrieved successfully",
"data": [
{
"index": 1,
"name": "q3-figures.pdf",
"type": "application/pdf",
"size": 248311,
"is_inline": false,
"content_id": null
}
]
}Returned inside the standard envelope.
Errors
| Status | When |
|---|---|
401 | No token, or the session expired or was signed out. Sign in again with `POST /mailbox-auth/login`. |
403 | The account has a temporary password: until `POST /security/password` succeeds, every other call answers this with `error_code: password_change_required`. |
404 | Message not found. |
422 | Validation Error |
Every status, with what causes it and what to do, is on the error reference.