Set up a bi-directional webhook for the Microsoft Teams Graph spoke
Configure a webhook to subscribe to Microsoft Teams with a ServiceNow callback URL.
[Omitted video] Description: Demonstrates how to set up bi-directional webhook for the Microsoft Teams Graph spoke.
Before you begin
- Request the required IntegrationHub subscription
- Activate the Microsoft Teams Graph spoke
- Role required: admin
Register a Microsoft Teams Graph webhook in ServiceNow instance
Register Microsoft Teams in your ServiceNow instance to notify the ServiceNow app when certain events occur in Microsoft Teams.
Before you begin
Role required: admin
Procedure
Navigate to Microsoft Teams Graph Spoke > Webhook Registry.
Click New.
On the form, fill in these fields:
Name Name to identify the webhook registry. For example, MS Teams Graph webhook registry.Client State Client State Path Microsoft Teams Graph webhook path. This field is auto-populated to api/sn_msteams_ahv2/ms_teams_webhook.Description Description of the webhook registry. Right-click the form header and click Save.
Click Callback URL.
The system auto-populates the webhook callback URL.
Create webhook subscription for a channel
Create a webhook subscription for the required channel in a team by testing the Subscribe Webhook subflow.
Before you begin
Role required: admin
Procedure
Navigate to Process Automation > Workflow Studio.
Click Subflows.
Open the Subscribe Webhook subflow.
Click Test.
On the form, fill in these values.
Field Description Webhook Registry Record Name Name of the webhook record you had provided when you registered the webhook in ServiceNow instance. For example, MS Teams Graph webhook registry.Change Type Type of change in the subscribed resource that should send a change notification. The supported values are: created,updated, anddeleted. You can provide multiple comma-separated values.Team ID Unique identifier of the team. Channel ID Unique identifier of the channel.
Test the Subscribe Webhook subflow for the required change types.
Click Run Test.
Subscription for the required channel is created.
See Building subflows for more information about testing subflows.
Customize a spoke subflow
Customize the required subflow that is shipped along with the spoke by creating a copy of it.
Before you begin
Role required: admin
Procedure
Navigate to Process Automation > Workflow Studio.
Click Subflows.
Open the required subflow that is shipped along with the Microsoft Teams Graph spoke.
For example, Process Inbound Notifications subflow.
Click the more actions icon (
More actions menu\) and select **Copy subflow**.
In New flow name, enter a unique name you want the copied subflow to have.
For example, Copy of Process Inbound Notifications subflow.
Click Copy.
A copy of the subflow is created.
Customize the subflow according to your requirement and publish it.
See Building subflows for more information about creating and using subflows.
Configure Microsoft Teams Graph webhook decision policy
Create webhook routing policy and subflow according to your requirements.
Before you begin
Role required: admin
Procedure
Navigate to Microsoft Teams Graph Spoke > Webhook Decision Policy
Click New.
On the form, fill in the fields.
| Field | Description |
|---|---|
| Label | Unique label to identify the routing policy. |
| Answer | Subflow that should be triggered when the conditions are met.
|
| Default Answer | Option to specify if this answer is the default answer. Default answer is applicable when the conditions are not met. |
| Condition | Conditions to be met when the incoming webhook delivers data from Microsoft Teams. |
Click Submit.
Note: These routing policies are saved in the Decision tables. Users are cautioned against directly updating or modifying data in these tables.