Skip to main content

Send Message To Chat

Description

Microsoft Teams: Send Message To Chat plugin step sends a message to the chat. Notes:

  • The step sends a message to an already existing chat and does not create a new chat.
  • If the attachment and card are attached together, both will be sent in a single message and the card will be on top of the attachment

References https://docs.microsoft.com/en-us/graph/api/chat-post-messages?view=graph-rest-1.0&tabs=http

Permissions Following are the required permissions

Permission typePermission (from least to most privileged)
Delegated (work or school account)offline_access, ChatMessage.Send, Chat.ReadWrite, Chat.ReadBasic, Chat.Read, Chat.ReadWrite, Files.Read, Files.ReadWrite, Files.Read.All Files.ReadWrite.All

Configurations

No.Field NameDescription
1Step NameName of the step. This name has to be unique in a single workflow.
Connection:
2Tenant IDSelect the Tenant ID.
The field data type is String. This is a mandatory field.
3Client IDSelect the Client ID.
The field data type is String. This is a mandatory field.
4Accept Value as variable staticLeave checkbox unchecked to accept Client Secret from a field in the previous steps of the stream using a drop down list.
Else enable checkbox for Client Secret field to appear as Text box.
5Client SecretSpecify the Client Secret of Microsoft Teams application. Client Secret is entered using a widget.
If the Accept Values as variable/static check box is selected, then the Client Secret field appears as text box and accepts static values or variables. Else, select Client Secret from the drop down list.
The field data type is String. This is a mandatory field.
6Accept Value as variable/staticLeave checkbox unchecked to accept Refresh Token from a field in the previous steps of the stream using a drop down list.
Else enable checkbox for Refresh Token field to appear as Text box.
7Refresh TokenProvide the Refresh Token provided by authorization grant flow.
If the Accept Values as variable/static check box is selected, then the Refresh Token field appears as text box and accepts static values or variables. Else, select Refresh Token from the drop down list.
The field data type is String. This is a mandatory field.
8Test ConnectionVerifies whether the connection is established or not.
Note: For the purpose of verification fields coming from previous steps are not allowed since field values can only be accessed when workflow is in running state. Static values and environment variables are allowed.
Input Fields:
1Chat Name/IDSpecify the Microsoft Teams’ Chat name or Chat ID.
The data type is String This field is mandatory.
2GetClick to list available chat names or chat ID.
3MessageSpecify the message you want to send to the chat.
The data type is String This field is mandatory.
4ImportanceSpecify the allowed values to act. Allowed values: 'normal', 'high', or 'urgent'.
Default is ‘normal’
Attachment Fields:
1Attachment Path/Content URL OR Paths of Files/URLs (JSON)Provide the valid file path or content URL of a file that is already uploaded on Onedrive or provide the JSON for multiple attachments.
a. Sample JSON for multiple file paths
{ "attachments":
[
{
"filePath":"D:\\Folder\\abc.txt"
},
{ "filePath":"D:\\Folder\\Capture.JPG"
}
] }
b. Sample JSON for multiple ContentURL
{ "attachments":
[
{
"contentURL":" https://onedrive.example.com/documents/myfile.docx "
},
{ " contentURL ":" https://onedrive.example.com/documents/myfile.docx "
}
] }
2BrowseClick to open the dialog to select the file path to attach.
3If File Exists On OneDrive PathProvide a valid option if the given file already exists on one drive.
Allowed Values: AutoRename, ThrowException, OverWrite.
Cards Fields:
1Card TypeProvide the valid Card Type to be sent.
Allowed Values: Adaptive Card, Hero card, Thumbnail card, Connector card for Microsoft 365 Groups
2Card Content JSONProvide the valid JSON payload of the card.
NOTE: Provide the valid JSON for sending the card with inline images by giving the reference of images in JSON as ‘hostedContents/temp id/$value’
For more information: https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http
Table fields
3Image Temporary IDProvide the temporary ID to the image which is used as an inline image in the JSON payload.
NOTE: The temporary ID must be the same across the JSON with ‘hostedContents/temp id/$value’, and it must be unique for all images.
4Static Image PathOn clicking in the input table, to open the dialog to select the file.
5Variable Image PathThe field is an optional field that accepts the value from the previous field or run-time parameters.
Output Fields:
1Message IDProvide output field name. Default value is ‘MessageID’.