---
sidebar_position: 3
description: Send voice 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 voice
 Sends an audio file as a voice message



`Function SendVoice(Val Token, Val ChatID, Val File, Val FileType = "m4a", Val ReplyID = 0, Val Keyboard = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Bot token |
  | ChatID | --chatid | String, Number | &#x2714; | Chat ID for sending |
  | File | --file | BinaryData, String | &#x2714; | File for sending |
  | FileType | --type | String | &#x2716; | Audio type: aac, ogg or m4a |
  | ReplyID | --reply | String, Number | &#x2716; | Replying message id if necessary |
  | Keyboard | --keyboard | Array Of String | &#x2716; | Buttons to the message if necessary |

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

:::tip
If you want the client to display this file as a playable voice message, it must be in aac, ogg, or m4a format

Method at API documentation: [POST /messages/sendVoice](https://teams.vk.com/botapi/#/messages/post_messages_sendVoice)

Parameters with Binary data type can also accept file paths on disk and URLs
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    Token   = "001.3501506236.091...";
    ChatID  = "689203963@chat.agent";
    ReplyID = "7582306518142305381";

    File     = "https://hut.openintegrations.dev/test_data/song.m4a"; // URL
    FilePath = GetTempFileName("m4a"); // Path

    CopyFile(File, FilePath);

    FileBD = New BinaryData(FilePath); // Binary

    Result = OPI_VKTeams.SendVoice(Token, ChatID, File);

    Result = OPI_VKTeams.SendVoice(Token, ChatID, FilePath, , ReplyID);

    Result = OPI_VKTeams.SendVoice(Token, ChatID, FileBD);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint vkteams SendVoice \
             --token "***" \
             --chatid "***" \
             --file "/tmp/jv1cg4nn.gie"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint vkteams SendVoice ^
             --token "***" ^
             --chatid "***" ^
             --file "/tmp/jv1cg4nn.gie"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "fileId": "I000bKtHKCFzbCD7iXpXO4693983431bd",
 "msgId": "7582235775735972959",
 "ok": true
}
```
