For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get attachments

Get message attachments by sandbox_id and message_id.

get
Authorizations
Api-TokenstringRequired

Pass the API token in the Api-Token

Path parameters
sandbox_idinteger · int64 · min: 1Required

Unique sandbox ID

Example: 4015
message_idinteger · int64 · min: 1Required

Unique message ID

Example: 427
Query parameters
attachment_typestringOptional

Attachment type

Example: inline
Responses
200

Lists attachments with their details and download paths.

application/json
idintegerOptional
message_idintegerOptional
filenamestringOptional
attachment_typestringOptional
content_typestringOptional
content_idstring · nullableOptional
transfer_encodingstring · nullableOptional
attachment_sizeintegerOptional
created_atstringOptional
updated_atstringOptional
attachment_human_sizestringOptional
download_pathstringOptional
get/api/sandboxes/{sandbox_id}/messages/{message_id}/attachments
curl -X GET https://mailtrap.io/api/sandboxes/{sandbox_id}/messages/{message_id}/attachments \
  -H 'Authorization: Bearer YOUR_API_KEY'
[
  {
    "id": 67,
    "message_id": 457,
    "filename": "test.csv",
    "attachment_type": "inline",
    "content_type": "plain/text",
    "content_id": null,
    "transfer_encoding": null,
    "attachment_size": 0,
    "created_at": "2022-06-02T19:25:54.827Z",
    "updated_at": "2022-06-02T19:25:54.827Z",
    "attachment_human_size": "0 Bytes",
    "download_path": "/api/accounts/3831/sandboxes/4394/messages/457/attachments/67/download"
  }
]

Last updated

Was this helpful?