---
sidebar_position: 1
description: Send text message and other functions to work with VKTeams in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, VKTeams]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Send text message
 Sends a text message to a chat



`Function SendTextMessage(Val Token, Val ChatID, Val Text, Val ReplyID = 0, Val Keyboard = "", Val Markup = "MarkdownV2") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Bot token |
  | ChatID | --chatid | String, Number | &#x2714; | Chat ID for message sending |
  | Text | --text | String | &#x2714; | Message text |
  | ReplyID | --reply | String, Number | &#x2716; | Replying message id if necessary |
  | Keyboard | --keyboard | Array Of String | &#x2716; | Buttons to the message if necessary |
  | Markup | --parsemod | String | &#x2716; | Markup type for message text: MarkdownV2 or HTML |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from VK Teams

:::tip
You can mention a user by appending their userId to the text in the following format @[userId]

Method at API documentation: [GET /messages/sendText](https://teams.vk.com/botapi/#/messages/get_messages_sendText)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    Token  = "001.3501506236.091...";
    ChatID = "AoLI0egLWBSLR1Ngn2w";
    Text   = "Message text";

    Result = OPI_VKTeams.SendTextMessage(Token, ChatID, Text);

    ChatID  = "689203963@chat.agent";
    ReplyID = "7582306518142305381";
    Text    = "<b>Bold text</b>";
    Markup  = "HTML";

    Keyboard         = New Array;
    ButtonsLineArray = New Array;

    ButtonsLineArray.Add(OPI_VKTeams.MakeActionButton("Button1", "ButtonEvent1", , "attention"));

    ButtonsLineArray.Add(OPI_VKTeams.MakeActionButton("Button2", , "https://openintegrations.dev"));

    Keyboard.Add(ButtonsLineArray);
    Keyboard.Add(ButtonsLineArray);
    Result = OPI_VKTeams.SendTextMessage(Token, ChatID, Text, ReplyID, Keyboard, Markup);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint vkteams SendTextMessage \
             --token "***" \
             --chatid "***" \
             --text "<b>Bold text</b>" \
             --reply "7567354422724936211" \
             --keyboard "[[{'text':'Button1','callbackData':'ButtonEvent1','style':'attention'},{'text':'Button2','url':'https://openintegrations.dev','style':'base'}],[{'text':'Button1','callbackData':'ButtonEvent1','style':'attention'},{'text':'Button2','url':'https://openintegrations.dev','style':'base'}]]" \
             --parsemod "HTML"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            :: JSON data can also be passed as a path to a .json file
            
            oint vkteams SendTextMessage ^
             --token "***" ^
             --chatid "***" ^
             --text "<b>Bold text</b>" ^
             --reply "7567354422724936211" ^
             --keyboard "[[{'text':'Button1','callbackData':'ButtonEvent1','style':'attention'},{'text':'Button2','url':'https://openintegrations.dev','style':'base'}],[{'text':'Button1','callbackData':'ButtonEvent1','style':'attention'},{'text':'Button2','url':'https://openintegrations.dev','style':'base'}]]" ^
             --parsemod "HTML"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "msgId": "7582235462203360338",
 "ok": true
}
```
