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 type | Permission (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 Name | Description |
---|---|---|
1 | Step Name | Name of the step. This name has to be unique in a single workflow. |
Connection: | ||
2 | Tenant ID | Select the Tenant ID. The field data type is String. This is a mandatory field. |
3 | Client ID | Select the Client ID. The field data type is String. This is a mandatory field. |
4 | Accept Value as variable static | Leave 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. |
5 | Client Secret | Specify 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. |
6 | Accept Value as variable/static | Leave 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. |
7 | Refresh Token | Provide 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. |
8 | Test Connection | Verifies 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: | ||
1 | Chat Name/ID | Specify the Microsoft Teams’ Chat name or Chat ID. The data type is String This field is mandatory. |
2 | Get | Click to list available chat names or chat ID. |
3 | Message | Specify the message you want to send to the chat. The data type is String This field is mandatory. |
4 | Importance | Specify the allowed values to act. Allowed values: 'normal', 'high', or 'urgent'. Default is ‘normal’ |
Attachment Fields: | ||
1 | Attachment 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 " } ] } |
2 | Browse | Click to open the dialog to select the file path to attach. |
3 | If File Exists On OneDrive Path | Provide a valid option if the given file already exists on one drive. Allowed Values: AutoRename, ThrowException, OverWrite. |
Cards Fields: | ||
1 | Card Type | Provide the valid Card Type to be sent. Allowed Values: Adaptive Card, Hero card, Thumbnail card, Connector card for Microsoft 365 Groups |
2 | Card Content JSON | Provide 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 | ||
3 | Image Temporary ID | Provide 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. |
4 | Static Image Path | On clicking in the input table, to open the dialog to select the file. |
5 | Variable Image Path | The field is an optional field that accepts the value from the previous field or run-time parameters. |
Output Fields: | ||
1 | Message ID | Provide output field name. Default value is ‘MessageID’. |