---
sidebar_position: 3
description: Write a message and other functions to work with VK 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, VK]
---

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

# Write a message
 Write a message to a user in the community's dialog



`Function WriteMessage(Val Text, Val UserID, Val Communitytoken, Val Keyboard = "", Val Parameters = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Text | --text | String | &#x2714; | Message text |
  | UserID | --user | String | &#x2714; | Recipient user ID |
  | Communitytoken | --ct | String | &#x2714; | Community chat bot token, which can be obtained in the settings |
  | Keyboard | --keyboard | String | &#x2716; | Keyboard JSON. See FormKeyboard |
  | Parameters | --auth | Structure Of String | &#x2716; | Authorization parameters. See GetAuthParameters |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from VK



```bsl title="1C:Enterprise/OneScript code example"
    Parameters = GetVKParameters();

    Text           = "Message from autotest";
    UserID         = "657846756";
    Communitytoken = "vk1.a.phxjN1ZbTM9Lt-4F_i8d-LvqA9mOQH20qMstHTeytoRzDphTXA7aKpd57CJTn56Apn1ZHKPOpcrLDca43LFrKijMAtOYMwD4spRCAAuh...";

    ButtonArray = New Array;
    ButtonArray.Add("Button 1");
    ButtonArray.Add("Button 2");

    Keyboard = OPI_VK.FormKeyboard(ButtonArray);
    Result   = OPI_VK.WriteMessage(Text, UserID, Communitytoken, Keyboard, Parameters);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint vk WriteMessage \
             --text "Message from autotest" \
             --user "657846756" \
             --ct "***" \
             --keyboard "{'buttons':[[{'action':{'type':'text','label':'Button 1'}},{'action':{'type':'text','label':'Button 2'}}]],'one_time':false}" \
             --auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            :: JSON data can also be passed as a path to a .json file
            
            oint vk WriteMessage ^
             --text "Message from autotest" ^
             --user "657846756" ^
             --ct "***" ^
             --keyboard "{'buttons':[[{'action':{'type':'text','label':'Button 1'}},{'action':{'type':'text','label':'Button 2'}}]],'one_time':false}" ^
             --auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "response": 1285
}
```
