How to set up webhooks with Microsoft Teams Bot on Tenklo
Receive Microsoft Teams bot activities in your app using Tenklo webhooks
Microsoft Teams sends your bot an activity for every message, mention, conversation update and card action. Point your bot's messaging endpoint at Tenklo and Tenklo verifies each activity, routes it to the right connection and forwards it to your app.
This page covers both the Microsoft Teams Bot and Microsoft Teams integrations. They route webhooks the same way.
How it works
- Teams sends the activity to your bot's messaging endpoint, which is your Tenklo webhook URL, through the Bot Framework connector.
- Tenklo verifies the Bot Framework token in the
Authorizationheader. The token must be signed by Microsoft, issued byhttps://api.botframework.com, issued to your bot's Microsoft App ID, and match the activity'sserviceUrl. - Tenklo routes the activity to the connection whose
tenantIdmatches the activity'schannelData.tenant.id.
Tenklo checks the token's audience against the client ID of your Tenklo integration. Your integration's client ID must be your bot's Microsoft App ID. With the Microsoft Teams integration, that means the bot has to use the same Microsoft Entra app as the integration. If it uses a different app, Tenklo rejects every activity.
Setup
1. Get your Tenklo webhook URL
In the Tenklo dashboard, open your Microsoft Teams Bot or Microsoft Teams integration and copy the Webhook URL.
2. Set it as the bot's messaging endpoint
- In the Azure portal, open your Azure Bot resource.
- Go to Settings > Configuration.
- Paste your Tenklo webhook URL in Messaging endpoint and select Apply.
3. Check the client ID
On the same Configuration page, compare the Microsoft App ID with the client ID of your Tenklo integration. They must be the same value. See How to register your own Microsoft Teams Bot.
4. Send a test message
Message the bot in Teams, then open the Logs tab in Tenklo. The activity shows up there once something consumes it, either webhook forwarding or a sync subscribed to its type (see Handle the webhook). Tenklo rejects an activity that fails verification with a 401, so it never reaches your app or Logs. If activities don't show up, check the client ID first (step 3).
Handle the webhook
Once routed, you have two options:
- Forward it to your app: Nango forwards the activity to your webhook URL with connection attribution. See External webhook forwarding.
- Process it in a sync: run a sync when the activity arrives using
webhookSubscriptionsandonWebhook. See Real-time syncs.
Subscriptions match the activity's type, for example message, conversationUpdate, messageReaction or invoke. Use ['*'] to receive every type.
For the activity schema, see Microsoft's Bot Framework activity reference.
Rollback strategy
To stop deliveries through Tenklo, clear the Messaging endpoint on the Azure Bot's Configuration page, or point it back at your own bot service.