---
sidebar_position: 8
description: Forward 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';

# Forward message
 Forwards an existing message to the current dialog box



`Function ForwardMessage(Val Token, Val MessageID, Val FromChatID, Val ChatID, Val Text = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Bot token |
  | MessageID | --messageid | String, Number | &#x2714; | Original message ID |
  | FromChatID | --fromid | String, Number | &#x2714; | Source chat ID |
  | ChatID | --chatid | String, Number | &#x2714; | Chat ID for message sending |
  | Text | --text | String | &#x2716; | Additional message text |

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

:::tip
Only the chatId from events can be passed to the FromChatID (the code from the chat link is not suitable))

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";
    FromChatID = "689203963@chat.agent";
    MessageID  = "7582306518142305381";

    Result = OPI_VKTeams.ForwardMessage(Token, MessageID, FromChatID, ChatID);

    Text = "Additional text";

    Result = OPI_VKTeams.ForwardMessage(Token, MessageID, FromChatID, ChatID, Text);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint vkteams ForwardMessage \
             --token "***" \
             --messageid "7582322723053913208" \
             --fromid "689203963@chat.agent" \
             --chatid "***" \
             --text "Additional text"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint vkteams ForwardMessage ^
             --token "***" ^
             --messageid "7582322723053913208" ^
             --fromid "689203963@chat.agent" ^
             --chatid "***" ^
             --text "Additional text"
        ```
    </TabItem>
</Tabs>


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