teams message attachments download
Auto-generated reference
This page is generated from checked-in CLI metadata for release v0.3.0. Do not edit it by hand.
Download attachments and inline images from a message.
Synopsis
teams message attachments download (--team TEAM_ID --channel CHANNEL_ID [--reply REPLY_ID] | --chat CHAT_ID) [MESSAGE_ID | --message MESSAGE_ID] [--index N] [--dir DIR | --path FILE]
Options
| Option | Value | Required | Env | Default | Description |
|---|---|---|---|---|---|
--team | TEAM_ID | no | Team ID for channel messages | ||
--channel | CHANNEL_ID | no | Channel ID for channel messages | ||
--chat | CHAT_ID | no | Chat ID for chat messages | ||
--reply | REPLY_ID | no | Reply ID for a reply within a channel thread | ||
--message | MESSAGE_ID | 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 a single item to stdout
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 |