Reputation: 1520
How do you get the connectorID and webhook ID (teams_webhook_id) from MS Teams? I'm trying to construct a webhook uri to send a POST request (notifications) to MS Teams. Looking for a reference to the webhook url format
The last part of the format teams_webhook_id is not documented very well on where to fetch/get the details form?
https://outlook.office.com/webhook/daxxxxx@d77xxxx/IncomingWebhook/23b0ef39058040339562b8cba6183e67/ca74xxxx-xxxx
Where to get the connectorID and webHookID?
Example
```
team_webhook_id = ??
teams_webhook_url = "https://outlook.office.com/webhook/"
teams_webhook_uri = teams_webhook_url+groupId+@+tenantId+teams_webhook_id
response = http.request('POST', teams_webhook_uri,
body=webhook_encoded_body)
Upvotes: 3
Views: 1734
Reputation: 1520
The format of the webhook in MS Teams is https://outlook.office.com/webhook/{groupId}@{tenantId}/IncomingWebhook/{connectorId}/{webHookId}
Unlikes slack, MSTeams cannot send a notification with to the channel name but needs a webhook
You can get this from MS Teams -> go to team name -> channel name -> connectors and click on configure.
Reference and Further reading: https://aws.amazon.com/premiumsupport/knowledge-center/sns-lambda-webhooks-chime-slack-teams/
Upvotes: 4
Reputation: 10804
You get them when you create the actual webhook. See here for how to do so.
Upvotes: 1