Loading...
Loading...
Read and send Microsoft Teams chat messages via Microsoft Graph v1.0. Use when the user mentions Microsoft Teams chats, a 1:1 or group chat, reading recent Teams messages, or sending a Teams chat message. (Channel messages are not covered — they need admin-consented scopes.)
npx skill4agent add acedatacloud/skills microsoft-teamscurl + jq$MICROSOFT_TEAMS_TOKENAuthorization: Bearer $MICROSOFT_TEAMS_TOKENhttps://graph.microsoft.com/v1.0{"error":{"code","message"}}message401403ForbiddenChat.ReadChat.ReadWriteChatMessage.Send403 "No authorization information present on the request"/me/chats/me/chatsChat.*G="https://graph.microsoft.com/v1.0"; AUTH="Authorization: Bearer $MICROSOFT_TEAMS_TOKEN"
# My chats (1:1 + group), most recent first; expand members for names
curl -sS -H "$AUTH" "$G/me/chats?\$top=20&\$expand=members" \
| jq '.value[] | {id, chatType, topic, members: [.members[].displayName]}'CHAT="CHAT_ID"
# Recent messages
curl -sS -H "$AUTH" "$G/chats/$CHAT/messages?\$top=20" \
| jq '.value[] | {from: .from.user.displayName, created: .createdDateTime, text: .body.content}'
# Send a message (confirm content with the user first). contentType html|text.
curl -sS -X POST -H "$AUTH" -H "Content-Type: application/json" \
-d '{"body":{"contentType":"html","content":"Hi from the assistant 👋"}}' \
"$G/chats/$CHAT/messages" | jq '{id, created: .createdDateTime}'ChannelMessage.Read.All/teams/{id}/channels/.../messagesbody.content$top$expand$