# Microsoft Teams

Microsoft Teams is a collaboration platform developed by Microsoft that enables real-time communication, file sharing, and teamwork through chat, video meetings, and integrated applications.

### How to use Microsoft Teams in ZBrain Flow <a href="#how-to-use-microsoft-teams-in-zbrain-flow" id="how-to-use-microsoft-teams-in-zbrain-flow"></a>

**Step 1: Add Microsoft Teams to Flow**

* Click the ‘+’ icon in ZBrain Flow.
* In the search bar, type “Microsoft Teams”.
* Select Microsoft Teams from the list of available connections.
* Choose the action you want to perform from the available options.

| **Action name**      | **Description**                                                 |
| -------------------- | --------------------------------------------------------------- |
| Create channel       | Create a new channel in Microsoft Teams.                        |
| Send channel message | Send a message to a team's channel.                             |
| Send chat message    | Send a message in an existing chat.                             |
| Custom API call      | Make custom API calls to specific endpoints in Microsoft Teams. |

### **How to connect Microsoft Teams to ZBrain Flow** <a href="#how-to-connect-microsoft-teams-to-zbrain-flow" id="how-to-connect-microsoft-teams-to-zbrain-flow"></a>

To establish a connection between Microsoft Teams and ZBrain Flow:

1. **Enter a connection name** – Provide a name for easy identification.
2. **Click ‘Connect’ to authorize** – Follow the authentication steps in the pop-up window.
3. **Grant permissions** – Approve the necessary permissions to enable access.
4. **Save the connection** – Click ‘Save’ to complete the setup.

### **Available actions for Microsoft Teams in ZBrain Flow** <a href="#available-actions-for-microsoft-teams-in-zbrain-flow" id="available-actions-for-microsoft-teams-in-zbrain-flow"></a>

Below are the available Microsoft Teams actions you can use in your ZBrain Flow, along with detailed descriptions and configuration options:

#### **1. Create channel** <a href="#id-1.-create-channel" id="id-1.-create-channel"></a>

**Configuration options:**

* **Connection**: Select an existing Microsoft Teams connection or create a new one.
* **Team ID**: Choose the team where the new channel will be created.
* **Channel name**: Provide a name for the new channel.
* **Channel description**: Enter a brief description to explain the purpose of the channel.

#### **2. Send channel message** <a href="#id-2.-send-channel-message" id="id-2.-send-channel-message"></a>

**Configuration options:**

* **Connection**: Select an existing Microsoft Teams connection or create a new one.
* **Team ID**: Select the team that contains the target channel.
* **Channel ID**: Select the specific channel where the message will be posted.
* **Content type**: Choose the format of your message content, either `text` or `HTML`.
* **Message**: Enter the content of the message you want to send.

#### **3. Send chat message** <a href="#id-3.-send-chat-message" id="id-3.-send-chat-message"></a>

**Configuration options:**

* **Connection**: Select an existing Microsoft Teams connection or create a new one.
* **Chat ID**: Choose the specific chat to which the message should be sent.
* **Content type**: Select the format of the message (`text` or `HTML`).
* **Message**: Enter the content of the message you wish to send.

#### **4. Custom API call** <a href="#id-4.-custom-api-call" id="id-4.-custom-api-call"></a>

**Configuration options:**

* **Connection**: Select an existing Microsoft Teams connection or create a new one.
* **Enter the URL**: Provide the full URL or relative path to the Microsoft Teams API endpoint.
* **Select the HTTP method**: Choose the appropriate HTTP method based on your action:
  * **GET** – Retrieve data (e.g., team information, channel messages, user details).
  * **POST** – Submit new data (e.g., send messages, create teams, add members).
  * **DELETE** – Remove a resource (e.g., delete messages, remove users from a team).
  * **PATCH / PUT / HEAD**—These are rarely or not supported by the Microsoft Teams API; use them only if explicitly documented.
* **Add headers**: Specify any required custom headers, such as authorization or content type. Click '+ Add Item' to include more headers.
* **Add query parameters**: Customize the API request by appending query parameters. Click '+ Add Item' to add more parameters.
* **Enter JSON body**: Provide the request payload in JSON format as needed by the endpoint.
* **Set timeout (in seconds)**: Define a timeout period to avoid long-running requests from stalling the flow.
