# SendMessage

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.MicrosoftTeams>

{% tabs %}
{% tab title="Parameter: Connection" %}

| Name                 | Description                                                                                                                                                             |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 🗝Token : `String`   | <p>Bearer token.</p><p><br>Default: <code>-</code><br>Example: <code>eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Imk2bEdrM0ZaenhSY1ViMkMzbkVRN3N5SEpsWSJ9...</code></p> |
| ChannelId : `String` | <p>Channel ID.</p><p><br>Default: <code>-</code><br>Example: <code>20%3au0yPT4vDedASF0InQKu233CiYHqdAtFnXA\_45UB6Zgo1%40thread.tacv2</code></p>                         |
| TeamId : `String`    | <p>Team ID.</p><p><br>Default: <code>-</code><br>Example: <code>19%3au0yPT4vDedPFASD3QKu233CiZwqdAtFnXA\_25UB6Zgo1%40thread.tacv2</code></p>                            |
| {% endtab %}         |                                                                                                                                                                         |

{% tab title="Parameter: Input" %}

| Name                                            | Description                                                                                                                                                                                                                                                                                                                                                          |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Subject : `String`                              | <p>The subject of the chat message, in plaintext.</p><p>Can be empty.</p><p><br>Default: <code>-</code><br>Example: <code>This is subject</code></p>                                                                                                                                                                                                                 |
| BodyType : `BodyTypes`                          | <p>The type of the content.</p><p>Possible values:</p><ul><li><code>text</code>:</li></ul><p>The type of the content.</p><ul><li><code>html</code>:</li></ul><p>The type of the content.</p><p><br>Default: <code>1</code><br>Example: <code>BodyTypes.html</code></p>                                                                                               |
| MessageContent : `String`                       | <p>Message content.</p><p><br>Default: <code>-</code><br>Example: <code>This is a plain message, This is html message to \<at id="0">Jane Smith>/at<</code></p>                                                                                                                                                                                                      |
| SetMentions : `Boolean`                         | <p>Set entities mentioned in the chat message.</p><p><br>Default: <code>False</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                               |
| MentionParameters : `MentionParameters[]`       | <p>List of entities mentioned in the chat message.</p><p>Supported entities are: user, bot, team, and channel.</p><p><br>Default: <code>-</code><br>Example: <code>{ \[ 0, MentionText, UserDisplayName, ef1c916a-3135-4417-ba27-8eb7bd084193, \[ foo, bar ], \[ 1, MentionText2, UserDisplayName2, ef1c916a-3135-4417-ba27-8eb7bd084194, \[ bar, foo ] }</code></p> |
| SetAttachments : `Boolean`                      | <p>Set references to attached objects like files, tabs, meetings.</p><p>Note: The file must already be in SharePoint. See <https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&#x26;tabs=csharp></p><p><br>Default: <code>False</code><br>Example: <code>true</code></p>                                                                |
| AttachmentParameters : `AttachmentParameters[]` | <p>References to attached objects like files, tabs, meetings.</p><p><br>Default: <code>-</code><br>Example: <code>{ \[ 1, reference, <https://m365x987948.sharepoint.com/sites/test/Shared%20Documents/General/foo.docx>, foo ], \[ reference, <https://m365x987948.sharepoint.com/sites/test/Shared%20Documents/General/bar.docx>, bar ], }</code></p>              |
| {% endtab %}                                    |                                                                                                                                                                                                                                                                                                                                                                      |

{% tab title="Parameter: Options" %}

| Name                     | Description                                                                                                                                                                       |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ThrowOnError : `Boolean` | <p>Throw an error on exception.</p><p>If set to false, exception message can be found in Result.ErrorMessage.</p><p><br>Default: <code>-</code><br>Example: <code>true</code></p> |
| {% endtab %}             |                                                                                                                                                                                   |

{% tab title="Result: Result" %}

| Name                    | Description                                                             |
| ----------------------- | ----------------------------------------------------------------------- |
| Success : `Boolean`     | <p>Operation complete without errors.<br>Example: <code>true</code></p> |
| ErrorMessage : `String` | <p>Error message.<br>Example: <code>An error occured...</code></p>      |
| {% endtab %}            |                                                                         |

{% tab title="Changelog" %}

## Changelog

### \[1.1.0] - 2025-02-17

#### Added

* Update: Microsoft.Graph 5.24.0 -> 5.73.0 MSTest.TestAdapter 3.8.0 -> 3.8.3 MSTest.TestFramework 3.8.0 -> 3.8.3

### \[1.0.0] - 2023-11-17

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
