/v1/workspaces/{workspace_id}/received/{id}/attachments/{position}AuthDownload one attachment of a received email
By its `position` from the detail's attachment manifest. Unscanned, untrusted bytes from a third party. Gated by `mail.message.body.read`.
Path parameters
workspace_id*string · uuidId of the workspace.
id*string · uuidReceived email id.
position*numberAttachment position (0-based).
Response · 200
Binary stream. `Content-Type` is the stored attachment media type; `Content-Disposition: attachment`.
Example
Request
GET https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/received/{id}/attachments/{position}
Authorization: Bearer YOUR_TOKENimport { Mail } from "@productcraft/mail";
// Reads PRODUCTCRAFT_API_KEY from the environment
const mail = new Mail();
const response = await mail.received.attachments.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "0");
const text = await response.text();mail.received.attachments.retrieve(id, position, options?): Response