microsoft-teams-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify Microsoft Teams outgoing webhooks. Use when building the callback URL for a Teams outgoing webhook (Manage team > Apps > Create an outgoing…
от hookdeck★ 104 звезды на GitHubОб этом скилле
Microsoft Teams Outgoing Webhooks
A Teams outgoing webhook acts like a lightweight bot. You create it on a team (Manage team > Apps > Create an outgoing webhook) with a name and an HTTPS callback URL. When someone @mentions it in a public channel of that team, Teams POSTs the message to your URL as a Bot Framework activity, signs it with Authorization: HMAC <base64>, waits about 5 seconds, and posts your JSON response as a reply in the same thread.
This skill covers outgoing webhooks (Teams calling you). Incoming webhooks and Workflows, which post into Teams, are a different feature.
When to Use This Skill
- How do I build a Microsoft Teams outgoing webhook endpoint?
- How do I verify the Teams
Authorization: HMACheader? - Why does my Teams HMAC never match? (usually: the security token wasn't base64-decoded, or the body was re-serialised)
- How do I reply to a Teams @mention from my webhook?
- Why doesn't my Teams outgoing webhook fire? (it needs an @mention in a public channel)
Verification (core)
const crypto = require('crypto');
function verifyTeamsRequest(rawBody, authorization, securityToken) { // rawBody: exact bytes
if (!authorization || !securityToken) return false;
const match = /^HMAC (\S+)$/i.exec(authorization.trim()); // "HMAC <base64>"
if (!match) return false;
const key = Buffer.from(securityToken.trim(), 'base64'); // DECODE the token
if (key.length === 0) return false;
const expected = crypto.createHmac('sha256', key).update(rawBody).digest();
const given = Buffer.from(match[1], 'base64');
return given.length === expected.length && crypto.timingSafeEqual(given, expected);
}
- Key: the security token Teams shows when you create the webhook, base64-decoded. Microsoft's samples do
Convert.FromBase64String(signingKey)(C#) andBuffer.from(sharedSecret, "base64")(Node). Using the token string as the key never matches. - Signed content: the raw request body as UTF-8 bytes. No timestamp, no URL.
- Header:
Authorization: HMAC <base64 digest>. Strip theHMACscheme and compare the digest in constant time. - Bad or missing signature:
401. Token not configured:500. Success:200with a JSON message.
For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.
Python: hmac.new(base64.b64decode(token), raw_body, hashlib.sha256).digest() compared with hmac.compare_digest. See references/verification.md.
Reply Within 5 Seconds
Teams makes a synchronous request and gives your code about five seconds before it times out. Whatever you return is posted as a reply to the message that mentioned the webhook:
{ "type": "message", "text": "This is a reply!" }
You can also return attachments with an Adaptive Card or Hero card. Outgoing webhooks support only the openURL card action. For slow work, reply right away ("Working on it") and post the result later through another channel, such as a bot or a Workflows webhook.
Hookdeck: the Microsoft Teams source type (MICROSOFT_TEAMS) verifies the Authorization: HMAC header with the security token, pasted as Teams shows it. Verification is optional on the source, and Hookdeck applies no timestamp window (Teams signs none). Hookdeck responds to Teams before your destination runs, so your handler's reply never reaches the channel, and Hookdeck's default response isn't a Teams message. Set a custom response on the source with content type JSON and a body such as {"type":"message","text":"Received"}.
Payload
Teams sends a Bot Framework message activity. Microsoft's page doesn't print a full sample; this one is illustrative and shows the fields handlers usually read:
{
"type": "message",
"id": "1731924900123",
"timestamp": "2026-11-18T10:15:00.123Z",
"channelId": "msteams",
"serviceUrl": "https://smba.trafficmanager.net/emea/",
"from": { "id": "29:1Xh...", "name": "Megan Bowen", "aadObjectId": "6d4b..." },
"conversation": { "isGroup": true, "conversationType": "channel", "id": "19:[email protected];messageid=1731924900123", "tenantId": "72f9..." },
"text": "<at>Helper</at> status",
"textFormat": "plain",
"channelData": { "teamsTeamId": "19:[email protected]", "teamsChannelId": "19:[email protected]", "tenant": { "id": "72f9..." } }
}
text includes the mention as <at>Name</at>; strip it to get the command. Microsoft's Node sample reads text and from.name.
Environment Variables
MICROSOFT_TEAMS_SECURITY_TOKEN=base64-token-from-teams # shown when you create the outgoing webhook
Local Development
# Express / Next.js (use 8000 for FastAPI). No install or account required.
npx hookdeck-cli listen 3000 microsoft-teams --path /webhooks/microsoft-teams
Use the printed HTTPS URL as the callba
Установить microsoft-teams-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл microsoft-teams-webhooks?
Receive and verify Microsoft Teams outgoing webhooks. Use when building the callback URL for a Teams outgoing webhook (Manage team > Apps > Create an outgoing webhook), verifying the Authorization: HMAC header with the base64-decoded security token, replying to an @mention within 5 seconds with a {"type":"message"} JSON response or an Adaptive Card, or debugging why the webhook doesn't fire or its HMAC never matches.
Как установить скилл microsoft-teams-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл microsoft-teams-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic