Microsoft teams
Microsoft Teams is a useful application used for business communication. This application is used as a messaging app for your organization. MS Teams enable real-time collaboration and communication. It helps you to create meetings, send files, and easy app sharing, all in a single place.
Authorization
Basic Auth
Microsoft Teams Basic authentication enables a web browser to provide credentials when the browser makes a request during an HTTP transaction. It’s required as the user credentials are not encrypted for network transmission but are sent over the network in plaintext. To use basic authentication, you are required to enable Secure Sockets Layer (SSL) encryption for the website otherwise, the credentials can be intercepted by any harmful user. Microsoft Teams uses a web application named Internet Information Services (IIS) website for creating the server. The configuration of basic authentication can be conducted for one or more zones in Microsoft Teams. You can get the basic authentication token by passing the user name and password. The Basic authentication (password is sent in clear text) in the Claims Authentication Types section of the Create New Web Application dialog.
Key | Description | Example |
---|---|---|
Username | Username is the sign in name of the users for accessing Microsoft Teams. | w|contoso\adam |
Password | It is a secret phase that helpful for protecting the data. | ****************** |
For more information please visit: Microsoft Teams Authentication
OAuth 2.0
The OAuth 2.0 authorization code grant type, or auth code flow, enables a client application to obtain authorized access to protected resources like web APIs.
Microsoft Teams uses OAuth 2.0 authentication. You must therefore create an App within your Microsoft Azure portal to obtain a Client ID and Client Secret.
See here for the Azure Active Directory application.
To Summarize the above documentation:
Either log into your existing Azure account or register for a free Azure account.
In your Microsoft Azure portal go to -> Azure Active Directory -> App Registrations -> New application registration.
Below are the details you should provide:
Name: Your Application Name
Reply URLs: you must add a callback URL to allow Microsoft Teams to be used in your Sapper Console and its Sapper Accounts.
The URL is:
https://
Your Sapper Service Domain
/connector/callback
Your Service Domain can be found in your Sapper console under Settings > General Settings > Service Domain.
Multi-tenanted: Yes
Set the appropriate permissions for conduct the further authentication.
To authenticate MS team into OAuth 2.0 you need to provide the below information:
Client ID: This is the Application ID displayed in the portal
Client Secret: Create a Password under Microsoft Azure portal > Azure Active Directory > App Registrations > Your Application > API Access > Keys. Copy and paste the password as the client secret.
Tenant ID: This is the Directory ID found below the Client ID in the portal.
Your Microsoft Teams Connector is now setup! You can test it by installing it in one of your Sapper accounts and executing one of the methods to confirm it can return some data.
When you creates Microsoft Teams app, you must be sure to enter Sapper's OAuth callback URL -Sapper - as a Callback URL.
For more information please visit: Microsoft Teams Authentication
API Key Authentication
To done the API key Authentication you need to enable single sign-on (SSO) in your MS Teams app. This is an authentication process that use a app users identity details from the MS Team application to enable access to the app. You are not needed to log in to your app within the teams environment again.
To authenticate the access token for MS teams you need to send a POST request to the /token identity platform endpoint:
Post: https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token
Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded
client_id={client_Id}
&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default
&client_secret={client_secret}
&grant_type=client_credentials
You will get access Token in response to process with the API key
{
"token_type": "Bearer",
"expires_in": 3599,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1uQ19WWmNBVGZNNXBP..."
}
For more information please visit: MS Teams Documentation
Microsoft teams Connections
Basic Auth Connections
Input | Key | Description | Example |
Select application | application | Select Microsoft Teams application |
|
Connection type | connection type | Select the type of connection. | REST |
Rest connection type | Rest Connection Type | Select the Basic connection type | Basic |
Connection name | name | Provide a name for the connection. | Microsoft Teams |
Connection description | description | Provide a description for the connection. |
|
Host name | host | Provide a string value for the URL of the user's Microsoft Teams account. |
|
Username | username | Provide a valid username for the given Microsoft Teams account. | exampleUser |
Password | password | Provide a password to authenticate all requests with. Cloud users need to generate an API token for this value. | exampleSecurePassword |
Header field | header | Provide the path of the endpoint for authentication. | Authorization |
Header prefix header | header prefix | Select the header prefix - |
|
OAuth 2.0 Connections
Input | Key | Description | Example |
Select application | application | Select Microsoft Teams application | Microsoft Teams |
Connection type | connection type | Select the type of connection. | REST |
REST connection type | rest connection type | Select the type of REST connection. | OAuth2.0 |
Connection name | name | Provide a name for the connection. | Microsoft Teams connection |
Connection description | description | Provide a description for the connection. |
|
Host name | host | Provide a string value for the URL of the user's Microsoft Teams account. |
|
Grant type | grant type | Provide the grant type - authorization code, password, client credentials. |
|
API Key Authentication
Input | Key | Description | Example |
Select application | application | Select Microsoft Teams application | Microsoft Teams |
Connection Mode | mode | Select custom connection mode | Custom |
Connection type | connection type | Select the type of connection. | REST |
REST connection type | rest connection type | Select the type of REST connection. | API Key |
Connection name | name | Provide a name for the connection. | Microsoft Teams connection |
Connection description | description | Provide a description for the connection. |
|
Host name | host | Provide a string value for the URL of the user's Microsoft Teams account. |
|
Key | key | Provide the key for the connection. |
|
Value | value | Add the value for the connection |
|
Header Parameter | header | Header parameters are used for user-defined custom HTTP headers for a request. |
|
Query Parameter | query | Query parameters are a defined set of parameters attached to the end of a URL. |
|
Actions
Send Message to a Specific Channel in a Team
Send message to a specific channel | key: sendMessagetoSpecificChannel
Key | Description | Examples |
---|---|---|
Teams ID | A TeamID is a unique identifier (UID) related to a specific team within Microsoft Teams. It’s a combination of alphanumeric. | Q12hj128ef00 |
Channel ID | In Microsoft Teams, the portion after channel/ in the URL and before the next slash is your channel id. It is a combination of alphanumeric phrase. | b12294gij-Q139kjt7t7bjb-qj79vhcptcj470gj-qjkb319671hnbf |
Message | Provide the message for your team. | “Sample “ |
Send Message to User
Send message to user | key: sendMessagetoUser
Key | Description | Examples |
---|---|---|
Chat ID | The chat ID is a unique chat session identifier used to find a specific chat session. The chat id can be a combination of multiple numeric phrase. | 165486277217 |
Message | Provide the message for your team. | “Sample” |
Create Chat
Create Chat | key: createChat
Key | Description | Example |
---|---|---|
Sender Email | Mention the email id of the sender for creating chat. | |
Receiver Email | Mention the email id of the receiver for creating chat. |