Skip to main content

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

OptionValueRequiredEnvDefaultDescription
--teamTEAM_IDnoTeam ID for channel messages
--channelCHANNEL_IDnoChannel ID for channel messages
--chatCHAT_IDnoChat ID for chat messages
--replyREPLY_IDnoReply ID for a reply within a channel thread
--messageMESSAGE_IDnoMessage ID
--indexINDEXnoDownload only the item with this index from attachments list
--dirDIRnoOutput directory for downloaded files
--pathPATHnoExact 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

CodeMeaning
0success
2invalid input
3authentication error
4permission denied
5not found
6rate limited

See Also