Get a download link for an attachment
get_attachment_download_linkGet a one-time link to download a file attached to an email, to open or work on it with your own tools: pass the email and the attachment's part, as read_email lists it. Run the returned download command (curl) to save it, which needs the ability to run shell commands or make HTTP requests. The link works once, for a few minutes, and whoever has it can fetch the file: use it only in that command, and never put it in a message, a file or a request to anywhere else. To attach the file to a draft or an email instead, use stage_attachment_from_email.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | The email's UID, as returned by list_emails or search_emails | |
| part | Yes | Which attachment, by its `part` as read_email lists it, e.g. "2" or "3.2". | |
| Yes | The account the email is in. | ||
| mailbox | Yes | Mailbox/folder the email is in, e.g. "INBOX" |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | Yes | Size in bytes. | |
| filename | Yes | ||
| mime_type | Yes | ||
| expires_at | Yes | When the link stops working, as RFC 3339: a few minutes from now. | |
| download_url | Yes | Where to GET the file. It works once, without an Authorization header; whoever has it can fetch the file, so it goes nowhere but the command that fetches it. | |
| download_command | Yes | The command that fetches the file; replace <path> with where to save it. |