teams message attachments download
Auto-generated reference
This page is generated from checked-in CLI metadata for release v0.9.0. Do not edit it by hand.
Download attachments and inline images from a message
Synopsis
teams message attachments download [OPTIONS] [MESSAGE_ID]
Options
| Option | Value | Required | Env | Default | Description |
|---|---|---|---|---|---|
--team | TEAM | no | Team ID (for channel messages) | ||
--channel | CHANNEL | no | Channel ID (for channel messages) | ||
--chat | CHAT | no | Chat ID (for chat messages) | ||
--reply | REPLY | no | Reply ID (for a reply within a channel thread) | ||
MESSAGE_ID | MESSAGE_ID | no | Message ID | ||
--message | MESSAGE | no | Message ID | ||
--index | INDEX | no | Download only the item with this index (from attachments list) | ||
--dir | DIR | no | Output directory for downloaded files | ||
--path | PATH | no | Exact output file path for a single item; use '-' for stdout |
Examples
Download all media from a chat message
teams message attachments download --chat "$CHAT_ID" "$MESSAGE_ID" --dir ./assets --output json
Stream one item as raw bytes (no JSON envelope)
teams message attachments download --chat "$CHAT_ID" "$MESSAGE_ID" --index 0 --path - > image.png
Exit Codes
| Code | Meaning |
|---|---|
| 0 | success |
| 2 | invalid input |
| 3 | authentication error |
| 4 | permission denied |
| 5 | not found |
| 6 | rate limited |