---
sidebar_position: 2
description: Send file 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 file
 Sends the file to the chat



`Function SendFile(Val Token, Val ChatID, Val File, Val Text = "", Val FileName = "", Val Markup = "MarkdownV2", Val ContentType = "image/jpeg") 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 |
  | Text | --text | String | &#x2716; | File caption |
  | FileName | --filename | String | &#x2716; | Displayed file name |
  | Markup | --parsemod | String | &#x2716; | Markup type for message text: MarkdownV2 or HTML |
  | ContentType | --type | String | &#x2716; | Content type for sending |

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

:::tip
Method at API documentation: [POST /messages/sendFile](https://teams.vk.com/botapi/#/messages/post_messages_sendFile)

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 = "AoLI0egLWBSLR1Ngn2w";
    Text   = "File caption";

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

    CopyFile(File, FilePath);

    FileBD = New BinaryData(FilePath); // Binary

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

    Result = OPI_VKTeams.SendFile(Token, ChatID, FilePath, Text);

    Result = OPI_VKTeams.SendFile(Token, ChatID, FileBD, Text, "ImportantDocument.docx");
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint vkteams SendFile \
             --token "***" \
             --chatid "***" \
             --file "/tmp/kokip4fo.m2v" \
             --text "File caption" \
             --filename "ImportantDocument.docx"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint vkteams SendFile ^
             --token "***" ^
             --chatid "***" ^
             --file "/tmp/kokip4fo.m2v" ^
             --text "File caption" ^
             --filename "ImportantDocument.docx"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "fileId": "jI7vnnXvXWrrn1qTJBP22L6939832d1bd",
 "msgId": "7582235681246687240",
 "ok": true
}
```
