Lokalisiert durch KI

E-Mail-Anhänge abrufen

Gibt nur die Anhangsliste einer E-Mail zurück, mit base64-kodiertem Inhalt.

GET/emails/{id}/attachments
Copy

Pfad-Parameter

idstring Required
Link

Die E-Mail-ID im Format em_xxx.

E-Mail-Anhänge abrufen

const response = await fetch('https://api.emailit.com/v2/emails/em_abc123xyz789def456/attachments', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
    'Content-Type': 'application/json'
  }
});

const result = await response.json();

Antwort-Felder

FeldTypBeschreibung
objectstringImmer "list"
dataarrayArray von Anhang-Objekten

Anhang-Objekt

FeldTypBeschreibung
filenamestringDateiname des Anhangs
content_typestringMIME-Typ
sizeintegerGröße des Anhangs in Bytes
content_idstring | nullContent-ID für eingebettete Anhänge
content_dispositionstring"attachment" oder "inline"
contentstringBase64-kodierter Anhang-Inhalt

Antworten

{
  "object": "list",
  "data": [
    {
      "filename": "dokument.pdf",
      "content_type": "application/pdf",
      "size": 12345,
      "content_id": null,
      "content_disposition": "attachment",
      "content": "JVBERi0xLjQKJcOkw7zDqc..."
    },
    {
      "filename": "logo.png",
      "content_type": "image/png",
      "size": 5678,
      "content_id": "logo@ihredomain.com",
      "content_disposition": "inline",
      "content": "iVBORw0KGgoAAAANSUhEUg..."
    }
  ]
}