Send Message as Bot
In this article
Overview
You can use this Snap to programmatically send messages to Microsoft Teams channels or chats using a bot identity. This enables automated communication and integration between your business systems and Teams.
Key benefits:
Sends automated messages to Teams channels or direct chats.
Includes rich content like text, images, and attachments.
Integrates Teams with other business applications and workflows.
Provides notifications and alerts directly within Teams conversations.
Enables bot-like interactions without building a full Teams bot application.
Snap Type
The Send Message as a Bot Snap is a Write-type Snap
Prerequisites
Valid Teams account with the required permissions.
Support for Ultra Pipelines
Works in Ultra Pipelines.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
|---|---|---|---|---|
Input | Document
|
|
| Example of an input document: {
"message": "Welcome to the channel! This is a bot message.",
"teamId": "b22e8da4-17c1-45c0-baa9-47aed7344e92",
"channelId": "19:fec55eed11e94378b2846b3d4bf48ea9@thread.tacv2"
} |
Output | Document
|
|
| The output document contains:
|
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab:
Learn more about Error handling in Pipelines. | |||
Snap Settings
Expression : JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.
SnapGPT : Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
Suggestion : Populates a list of values dynamically based on your Account configuration.
Upload : Uploads files. Learn more.
Learn more about the icons in the Snap Settings dialog.
Field Name |
| Field Type | Description |
|---|---|---|---|
Label*
| String | The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline. Default Value: Send Message as Bot | |
Service URL* | String/Expression | Specify the Service URL. This Snap allows messages to be sent successfully even when the Service URL field contains non-standard Service URLs. For example, when a Service URL such as the following is provided, the messages are successfully delivered as long as the Conversation ID and Message fields are valid.
This behavior is caused by the Microsoft Bot Framework API’s routing layer, which only validates and routes requests based on the
We recommend that you always use the documented and supported endpoint format as shown below: All clients must use only valid and documented service URL structures to ensure compatibility with future updates of the Microsoft Bot Framework. Learn more: https://learn.microsoft.com/en-us/answers/questions/5576695/unexpected-behavior-bot-framework-api-accepts-arbi?page=0&orderby=helpful&comment=answer-12273566&translated=false#newest-answer-comment Default Value: https://smba.trafficmanager.net/teams | |
Conversation ID
| String/Expression | The Conversation ID is a unique identifier for a Microsoft Teams conversation (channel or chat) that you need to obtain from Microsoft Teams. The Conversation ID is obtained from the user’s message activity response. The key difference between the conversation ID in a personal chat and a channel is that in a channel, the message ID is included in the conversation ID. This inclusion allows replies to be sent in the same message thread. If the message ID is not included, the message will appear as a separate thread. Here’s an example of a conversation with a message ID: '19:fec55eed11e94378b2846b3d4bf48ea9@thread.tacv2;messageid=1758791100665' You can use any of the following methods to obtain the Conversation ID:
For production use, you'd typically want to:
Default Value: N/A
| |
Text format* | Dropdown list | The format for the text message. The supported formats are Plain/Markdown and XML. Default Value: N/A | |
Message* | String/Expression | The actual content that will be sent to the Microsoft Teams channel or chat. It contains the body text of the message that your bot will post to Teams, and users will see in the conversation. This field supports Plain text, Rich formatting text, and Unicode characters. You can use expressions to make messages dynamic. For example, Default Value: N/A | |
Images | Use this field set to attach image files to your Teams messages. This allows your bot to send visual content along with text messages to enhance communication and provide richer information. | ||
URL/Data | String/Expression | The URL for the images that are publicly accessible or Base64-encoded image data for embedded images. Default Value: N/A | |
Content type | String/Expression | The format of the message content to send to Microsoft Teams. This field determines how Teams interprets, processes, and renders your message content. Default Value: N/A | |
Name | String | The name of the image to help identify your bot in Teams conversations. Default Value: N/A | |
Number of Retries | String/Expression | The maximum number of attempts to attempt when the Snap fails. Default Value: N/A | |
Retry interval (seconds) | String/Expression | The time interval between two successive retry requests. A retry happens only when the previous attempt resulted in an exception. Default Value: N/A | |
Snap Execution
| Dropdown list | Select one of the following three modes in which the Snap executes:
Default Value: | |
Example
Send a bot message to the Teams channel
This example pipeline demonstrates sending a message as a bot to a Microsoft Teams channel. It generates a test message containing various Unicode characters and special symbols, maps the necessary parameters for the Teams API call, and sends the message with an image attachment to a specified Teams conversation.
Configure the JSON Generator Snap to generate a comprehensive test message containing placeholder text and various Unicode characters, including emojis, international characters, mathematical symbols, and special characters.
Lorem ipsum text - Standard placeholder text
Various Unicode characters - International characters, emojis, mathematical symbols
Special characters - Testing how Teams handles different character encodings
Configure the Mapper Snap to map various parameters needed for the Teams API call (conversation ID, service URL, and message content), preparing the data structure required for sending messages to the Teams channel.
On validation, the Mapper Snap maps various Teams bot configuration parameters, including conversation IDs, service URLs, and message content, for sending to the Teams channel.
Configure Send Message as Bot Snap to send the mapped message content as a bot to the specified Teams conversation, including an image attachment, and use plain text formatting for the message.
On execution, the Snap sends the mapped message content as a bot to a Microsoft Teams channel, including an attached image from SnapLogic's media kit.
Downloads
Download and import the pipeline into the SnapLogic application.
Configure Snap accounts, as applicable.
Provide pipeline parameters, as applicable.
Snap Pack History
Related Content
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2025 SnapLogic, Inc.