MS Teams does not need any API Key or Client ID to send notifications. Our current implementation is based on the Incoming Webhook URL. It is a URL that you can use to send messages to a specific channel. This URL needs to be stored on the subscriber entity

Similar to Discord, the credential for this provider needs to be stored in the subscriber entity.

Creating incoming webhook URL

Checkout step by step instructions on microsoft team’s documentation on how to create an incoming webhook url.

Steps to create incoming webhook url

Storing webhook url on subscriber entity

The URL generated above will be the target channel of a subscriber that you want to integrate with. To make this connection, you have to:

  1. Copy the URL that you generated above
  2. Update the subscriber credentials with this URL using the MS Teams provider id. You can do this step by using the @novu/node library, as shown below:
import {
  Novu,
  ChatProviderIdEnum
} from '@novu/node';

const novu = new Novu("<NOVU_SECRET_KEY>");

await novu.subscribers.setCredentials(
'subscriberId',
ChatProviderIdEnum.MsTeams, // providerId
{ webhookUrl: "<WEBHOOK_URL>" },
'msteams-MnGLxp8uy' // integration identifier
);

Checkout the API reference for more details.

  • subscriberId is a custom identifier used when identifying your users within the Novu platform.
  • providerId is a unique provider identifier. We recommend using our ChatProviderIdEnum to specify the provider.
  • The third parameter is the credentials object, in this case, we use the webhookUrl property to specify the MS Teams channel webhook URL or by calling the Update Subscriber Credentials endpoint on Novu API. Check endpoint details here.

If you are looking to use provider in different way or your usecase is not covered by this documentation, you can always reach out to our team at support@novu.co or via Discord

Was this page helpful?