Skip to main content

Send Message To Channel

Description

Microsoft Teams: Send Message To Channel plugin step sends a message to the channel.

References https://docs.microsoft.com/en-us/graph/api/channel-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)Channel.ReadBasic.All ChannelMessage.Read.All ChannelMessage.ReadWrite ChannelMessage.Send ChannelSettings.Read.All ChannelSettings.ReadWrite.All Directory.Read.All Directory.ReadWrite.All Group.Read.All Group.ReadWrite.All GroupMember.Read.All offline_access, Files.Read, Files.ReadWrite, Files.Read.All, Files.ReadWrite.All

Notes:

  • If multiple team names with the same name are present, then provide the Team ID or unique team name.
  • Channel name cannot end with a period (.). The following special characters are not supported: ~#%&*{}+/\:<>?|'".
  • 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.

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.
For more details, see connection documentation.
The field data type is String. This is a mandatory field.
3Client IDSelect the Client ID.
For more details, see connection documentation.
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:
1Team Name/IDSpecify the Microsoft Teams team name or Team ID.The data type is String This field is mandatory.
2GetClick to list available teams in your user account.
3Channel Name/IDSpecify all channel name or ID present in the team.
The data type is String This field is mandatory.
4GetClick to list all channels present in the team in your user account.
5SubjectSpecify the subject of the message.
6MessageSpecify the message you want to send to the channel.
The data type is String This field is mandatory.
7ImportanceSpecify 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’.