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

Integration 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

Connecting with Microsoft Teams

To connect with Microsoft Teams following details are required:

  • Label: 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.
  • 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.

Actions with Microsoft Teams

Send Message

Send a new message to the specified channel/member.

Inputs to this Action

  • Connection: Choose a connection that you have created.
  • 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 of Action
json containing following items:

  • 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.

Inputs to this Action

  • Connection: Choose a connection that you have created.
  • 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 of Action
Array of JSON containing message object

{
   "@odata.type":"#microsoft.graph.chatMessage",
   "attachments":[
      
   ],
   "body":{
      "content":"Hi ritesh",
      "contentType":"text"
   },
   "channelIdentity":{
      "channelId":"19:[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?