insync_download_attachment
Downloads a single secure-message attachment by master ID and 0-based index, saving it to disk locally or returning bytes inline on hosted servers.
Instructions
Download one file attached to a secure message. Identify it by the message’s master id and the attachment’s position (index) from insync_list_attachments. On a local install the file is saved to disk and the path returned; on a hosted server the bytes come back inline. The download goes through the portal — never direct storage.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | The attachment’s 0-based position from insync_list_attachments. | |
| master_id | Yes | The message’s master id (TODOMasterId) from insync_list_messages. | |
| output_dir | No | Directory to save into (local install only; ignored on a hosted server, which returns bytes inline). Defaults to INSYNC_OUTPUT_DIR or ~/Downloads; must resolve inside an allowed root. |