Connectors

Contact support

Microsoft Teams - Getting started in Peliqan

Microsoft Teams - Getting started in Peliqan

Microsoft Teams is cloud-based team collaboration software that offers core capabilities, including business messaging, calling, video meetings and file sharing. Businesses of all sizes can use Teams, which can be accessed via desktop, any internet-connected device and the Teams mobile app.Microsoft Teams integrates with other Microsoft business applications, including Exchange, PowerPoint and SharePoint Microsoft Teams provide features like chat, calls, video conferencing, screen sharing, polling, webinars, etc.

This article provides you an overview to get started with the Microsoft Teams connector in Peliqan. Please contact support if you have any additional questions or remarks.

Contents

Terminology

  1. Team : Teams are groups of people who connect and collaborate on work and other projects.
  2. Channel : Within each team, users can create channels to organize their communications by topic, like news items, monthly reports or more lighthearted chats. A channel can be public or private. Private channel is the most secured way to share confidential data.
  3. Chat : Chat lets you connect with others, stay up to date on projects, and express yourself. It helps directly reaching out to teammates or any external person directly. Chats can be One-On-One and Group Chats.
  4. Mentions : Users can use mentions to message and alert other users
  5. Feeds : The activity feed provides a summary of messages, replies, mentions and other activities happening within team channels
  6. Threads : A series of messages creates a thread. Users replying to a message should select the Reply option instead of creating a new conversation and thread.

Discovering Team ID

  1. Open Microsoft Teams App.
  2. On the left toolbar, click on Teams icon.
  3. Once inside Teams, click on 3-dots at the right of the Team name and a pop-up menu will appear
  4. image
  5. On pop-up menu, click on “Get link to Team”.
  6. A pop-up window will appear on the screen with Team URL. On the URL, copy value of groupId
  7. image

Discovering Channel ID

  1. Open Microsoft Teams App.
  2. On the left toolbar, click on Teams icon. Inside teams, select any Channel.
  3. On right side of Channel Name, click on 3-dots and a pop-up menu will appear. On pop-up menu click in “Get Link to Channel”
  4. image
  5. A pop-up window will appear on the screen with Channel URL. On the URL, copy URL encoded Channel ID placed between channel and general in URL.
image

Sample URL : https://teams.microsoft.com/l/channel/19%3Ad9Mcx84nowbsPcSgbvJwx7wKE-onikns_xxxxxE1%40thread.tacv2/General?groupId={team_id}&tenantId={tenant_id}

Discovering Chat ID

There are many ways to get Chat ID of a conversation, either Group Chat or one-to-one chat.

  1. Using Microsoft Teams Web :
    1. Open Microsoft Teams on browser. Use : https://teams.microsoft.com
    2. Open the desired chat. In the URL, one can find the chat ID after “conversations”. This feature is only supported in Classic Teams(v1)
    3. image
  1. Using Peliqan Data Activation functions to get desired Chat providing the other user’s display Name(for one-to-one chat, like Peliqan Dev in the picture above) or Topic Name( for group chats).
  2. This method is detailed under Microsoft Teams Data Activation( see below)

Connecting Microsoft Teams in Peliqan

Peliqan connects to Microsoft Teams performing OAuth flow. Peliqan App is verified by microsoft and signs in on behalf of the user once Authorization flow is completed.

image

Authentication

  1. Start the OAuth Connection flow by clicking on ‘Connect Microsoft Teams Writeback’.
  2. If you are signed in with multiple Microsoft accounts on browser, select the Microsoft Teams account and authenticate yourself by entering credentials.
  3. Allow Peliqan app to login on your behalf and access Microsoft Teams Data.
  4. Once OAuth flow is completed, you will be redirected back to Peliqan to perform Writeback operations.

Microsoft Teams Data Activation

Peliqan provides lot of data activation function which enables users to communicate with Microsoft Teams application through Python Scripts.

Supposably, we have already a team account and we fetch Team ID using the method mentioned above.

Creating a Channel

“Add Channel” data activation method helps creating a channel. It requires a team and compulsory details for the channel.

image

Retrieving all Channels

“Get Channels” data activation method helps fetching all channels under the team. It requires a team ID.

It returns list of channel objects present.

image

Sending message to a channel

“Add Channel Message” data activation method is used to send a message to a chanel. It requires Team_Id, desired Channel ID and message content.

image
image

Get all users under the tenant

“Get Users” function gets you all the users under the same tenant or organisatons.

Results from these functions are useful while creating a chat, fetching chat id or sending message into a chat.

image

Finding a Chat

Chat can be one-on-one( having two members) or group( with at least 2 members).

  1. Find One One-On-One Chat
  2. “Find OneonOne Chat” method is used to get one-on-one chat details by simply providing displayName of the other member. DisplayName of the user is unique and cannot be edited.

    image
    image
  3. Find Group Chat
  4. “Find Group Chat” method details about a group chat by providing the Topic name of the Group.

    image

image

Creating a Chat

Chat can be one-to-one or in a group. To add people in a chat this function requires user_id of intended participants.

“Add Chat” function required user ids of members in user.binddata and type of chat( blue boxes). One can also decide the membership type of the user( red box) . Additionally, one can define multiple roles for a user like owner or guest.( green boxes)

image

One-on-One Chat

‘chatType’ for one-to-one chat has ‘chatType’ as ‘oneOnOne’. Point to remember, one-to-one chat can have at most 2 members

image

Group Chat

For Group chat, chatType changes to “group” and a group must have at least 2 members.

Sending message to a chat

“Add Chat Message” data activation function enables you to send message to a teams chat either oneOnOne or Group with Chat ID being provided.

Peliqan provides two ways to find finding the chat ID which are :

  1. Getting list of all the chats and fetching the required chat ID
    1. “Get Chats” function provides a list of chats having chat object where each object contains chat metadata which includes Chat displayName, Chat ID, last message sent, type of chat, members involved,etc.
    2. Required chat ID can be pulled from the list.
    3. image
    4. Now from the list, get the desired Chat ID and send a message using “Add Chat Message” activation function.
    5. image
  2. Finding one specific Chat based on details provided by user and sending message.
  3. This method is available for chatType as one-to-one where we provide other member displayName and in response we get chatDetails.

    image

    “FindOne Chat” function is used which requires displayName to be passed as argument.DisplayName:

    image

    Now pulling chat_id from the same response we pass it to “Add Chat Message” method to send a message to the chat.

    image
  1. Sending HyperLink in message to a chat
  2. Use add_chat_message method to send message. When sending a hyperlink message using the HTML <a></a>(Anchor) tag, please ensure “hyperlink reference” is not enclosed in quotes.

    image

Template: send alert to MS Teams

Click here for an example template on how to send an alert to MS Teams:

Send alert to MS TeamsSend alert to MS Teams