Example
What you'll build
This integration connects to Microsoft Teams and retrieves the channels that belong to a team. An automation runs the flow, calls the connector, and logs the returned channel collection. You'll bind every credential to a configurable variable, so no secret is stored in the integration itself.
Operations used:
- List Channels : Retrieves the collection of channels in the specified team.
Architecture
Prerequisites
- A Microsoft 365 account with access to Microsoft Teams.
- An application registered in Microsoft Entra ID, with a client secret and admin-consented Microsoft Graph application permissions.
- The directory (tenant) ID of your organization, which forms the OAuth2 token endpoint.
Setting up the Microsoft Teams integration
New to WSO2 Integrator? Follow the Create a New Integration guide to set up your integration first, then return here to add the connector.
Adding the Microsoft Teams connector
Step 1: Open the connector palette
Select Add Connection in the Connections section.
Step 2: Select the Microsoft Teams connector
- Enter
microsoft.teamsin the search field. - Select the Teams connector card.
Configuring the Microsoft Teams connection
Step 3: Bind the connection parameters to configurable variables
Switch Config to expression mode, then bind each authentication value to a configurable variable.
- Config : The configuration used to initialize the connector, holding the OAuth2 client credentials.
- Connection Name : The name that identifies this connection across the integration.
Step 4: Save the connection
Select Save Connection and verify that the connection appears in the Connections section.
Step 5: Set actual values for your configurables
- Select Configurations at the bottom of the project tree under Data Mappers.
- Enter a value for each configurable listed below before you run the integration.
- tokenUrl (
string) : The Microsoft Entra ID OAuth2 token endpoint for your tenant. - clientId (
string) : The application (client) ID of your registered application. - clientSecret (
string) : The client secret generated for your registered application. - teamId (
string) : The unique identifier of the team whose channels you want to list.
Configuring the Microsoft Teams List Channels operation
Step 6: Add an automation entry point
- Select Add Entry Point next to Entry Points.
- Select Automation.
- Select Create to accept the settings.
Step 7: Expand the connection and configure the List Channels operation
- Select the + node between Start and Error Handler.
- Expand teamsClient to display its operations.
- Select List Channels and enter its required values.
- Team Id : The unique identifier of the team, bound to a configurable variable.
- Result : The name of the variable that holds the returned channel collection.
- Result Type : The response type of the operation, which the editor sets for you.
- Select Save.
Step 8: Log the List Channels result
- Select the + node between List Channels and Error Handler.
- Expand Logging, then select Log Info.
- Switch Msg to expression mode and reference the result variable.
- Select Save to return to the visual flow.
Try it yourself
Try this sample in WSO2 Integration Platform.
More code examples
The Microsoft Teams connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:
- Team and channel setup — Provision a new team and create a channel within it.
- Channel message thread — Post a message to a channel, reply to it, and add a reaction.
- Channel member management — Create a private channel with an owner and list its members.
- Team tag management — Create a teamwork tag on a team and list all its tags.





