get-mail-attachment-content
get-mail-attachment-contentDownload the raw bytes of a file attachment of an Outlook message in the signed-in user's mailbox, by message ID and attachment ID.
Instructions
Download the raw bytes of a file attachment of an Outlook message in the signed-in user's mailbox, by message ID and attachment ID.
đź’ˇ TIP: Find the attachment id with list-mail-attachments first. With the server's blob output on, the bytes come back as a file resource; pass fileName (the attachment's name) to name it. Files over the server's download limit are refused with an error naming the limit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileName | No | Name of the file, used as the last segment of the returned resource URI when the server runs with blob output. Optional. | |
| messageId | Yes | Value for the 'messageId' path segment. Pass it under the name 'messageId', not as 'id'. Use the 'id' field of the message object as returned by Microsoft Graph. | |
| attachmentId | Yes | Value for the 'attachmentId' path segment. Pass it under the name 'attachmentId', not as 'id'. Use the 'id' field of the attachment object as returned by Microsoft Graph. | |
| fetchAllPages | No | Follow @odata.nextLink and merge up to 100 pages into one response. Can return enormous payloads—only when the user explicitly needs a full export. Prefer a small $top first, then paginate or narrow with $filter/$search. | |
| includeHeaders | No | Include response headers (including ETag) in the response metadata | |
| excludeResponse | No | Exclude the full response body and only return success or failure indication |