Microsoft Teams

Microsoft Teams is a unified communication and collaboration platform that combines persistent workplace chat, video meetings, file storage (including collaboration on files), and application integration

Connect Microsoft Teams with LogicHub

Prerequisites

  • Ensure that the Azure app you're connecting (by providing the Client ID below) has a Client Secret in Certificates and secrets tab of the Azure app. If not, generate and keep it. We do not require the secret to be entered anywhere in LogicHub for establishing the connection, but it'll fail the connection if it is not generated already.
  • Set "Allow Public Client Flows" in Authentication tab of the Azure app to "Yes".
  • Grant "admin consent" to whatever API permissions you've added to the app. Ensure that at least the following API permission is added for establishing the connection and sending the message.
  • The user on behalf of whom you want to send the message should not have MFA (Multi-Factor Authentication) enabled. You can get it disabled from the admin of your organization for the particular user by following the instructions at Microsoft
  1. Navigate to Automations > Integrations.
  2. Search for Microsoft Teams.
  3. Click Details, then the + icon. Enter the required information in the following fields.
    • Label: Enter a connection name.
    • Reference Values: Define variables here to templatize integration connections and actions. For example, you can use https://www.{{hostname}}.com where, hostname is a variable defined in this input. For more information on how to add data, see 'Add Data' Input Type for Integrations.
    • Verify SSL: Select option to verify connecting server's SSL certificate (Default is Verify SSL Certificate).
    • Remote Agent: Run this integration using the LogicHub Remote Agent.
    • Tenant ID: The directory tenant that you want to log the user into.
    • Client ID: The Application (client) ID that the Azure portal - App registrations page assigned to your app.
    • Username: The user's email address (user principal name).
    • Password: The user's password.
  4. After you've entered all the details, click Connect.

Actions for Microsoft Teams

Send Message

Send a new message to the specified channel/member.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input Name

Description

Required

Team Name Column Name

Column name from the parent table that contains the team name.

Required

Recipient Type

Recipient type to send a message (default is "Channel").

Optional

Recipient Name Column Name

Column name from the parent table that contains recipient name (channel/member) to send a message in.

Required

Message Type

Message type to send (Default is "Plain Text").

Optional

Message

Jinja-template for message to send. Example: {{msg1}},{{msg2}}.

Required

  • Team Name Column Name: Column name from the parent table that contains the team name.
  • Recipient Type (Optional): Recipient type to send a message (default is "Channel").
  • Recipient Name Column Name: Column name from the parent table that contains recipient name (channel/member) to send a message in.
  • Message Type (Optional): Message type to send (Default is "Plain Text").
  • Message: Jinja template for message to send. Example: {{msg1}},{{msg2}}.

Output

A JSON object containing multiple rows of result:

  • has_error: True/False
  • error: message/null
  • result: Success/Failure message.

List Messages

Retrieve the list of messages (without the replies) in a channel of a team. By using delta query, you can get new or updated messages in a channel.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input Name

Description

Required

Team Name Column Name

Column name from the parent table that contains the team name.

Channel Name

Column name from the parent table that contains recipient name channel to receive messaged from.

Limit

Maximum number of messages to fetch in a call. (Default is 100000).

Last modified Start Time

Jinja-templated string representing a date time. Results having last modified date time greater than this value will be returned. (Default is batch start time).
Example: 2021-01-01T01:01:00.000Z.

Last Modified End Time

Jinja-templated string representing a date time. Results having last modified date time less than this value will be returned. (Default is batch end time).
Example: 2021-01-01T01:01:00.000Z.

Output

Array of JSON containing message object.

{
   "@odata.type":"#microsoft.graph.chatMessage",
   "attachments":[
      
   ],
   "body":{
      "content":"Hi ritesh",
      "contentType":"text"
   },
   "channelIdentity":{
      "channelId":"19:953b5d1e34c54754a9a893[email protected]",
      "teamId":"63a8df76-1eb1-4dd0-ae72-3a82e8179e7a"
   },
   "chatId":null,
   "createdDateTime":"2021-03-04T04:18:01.514Z",
   "deletedDateTime":null,
   "error":null,
   "etag":"1614831481514",
   "from":{
      "application":null,
      "conversation":null,
      "device":null,
      "user":{
         "displayName":"Ritesh Chaurasia",
         "id":"924215a0-4a14-4e01-b388-a88672802f97",
         "userIdentityType":"aadUser"
      }
   },
   "has_error":false,
   "id":"1614831481514",
   "importance":"normal",
   "lastEditedDateTime":null,
   "lastModifiedDateTime":"2021-03-04T04:18:01.514Z",
   "locale":"en-us",
   "mentions":[
      
   ],
   "messageType":"message",
   "policyViolation":null,
   "reactions":[
      
   ],
   "replyToId":null,
   "subject":null,
   "summary":null,
   "webUrl":"https://teams.microsoft.com/l/message/19%3A953b5d1e34c54754a9a89340bc6e291e%40thread.tacv2/1614831481514?groupId=63a8df76-1eb1-4dd0-ae72-3a82e8179e7a&tenantId=80a36173-9e4c-47ae-b5ae-4d5fd8f4b657&createdTime=1614831481514&parentMessageId=1614831481514"
}

Did this page help you?