---
sidebar_position: 5
description: Send file and other functions to work with Bitrix24 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, Bitrix24]
---

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

# Send file
 Send disk file to chat



`Function SendFile(Val URL, Val ChatID, Val FileID, Val Description = "", Val Token = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | URL | --url | String | &#x2714; | URL of webhook or a Bitrix24 domain, when token used |
  | ChatID | --chat | String, Number | &#x2714; | Chat ID |
  | FileID | --fileid | String, Number | &#x2714; | File ID from UploadFileToFolder method |
  | Description | --description | String | &#x2716; | File description |
  | Token | --token | String | &#x2716; | Access token, when app auth method used |

  
  Returns:  Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API

:::tip
Method at API documentation: [im.disk.file.commit](https://dev.1c-bitrix.ru/learning/course/index.php?COURSE_ID=93&LESSON_ID=11485)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    URL         = "https://b24-ar17wx.bitrix24.by/rest/1/h0m...";
    ChatID      = "3516";
    File        = "https://hut.openintegrations.dev/test_data/document.docx"; // Binary Data, URL or path to file
    Description = "Very important file";

    Directory = OPI_Bitrix24.GetChatFilesFolder(URL, ChatID);
    FolderID  = Directory["result"]["ID"];

    UploadedFile = OPI_Bitrix24.UploadFileToFolder(URL, "Imortant doc.docx", File, FolderID);
    FileID       = UploadedFile["result"]["ID"];

    Result = OPI_Bitrix24.SendFile(URL, ChatID, FileID, Description);

    URL    = "b24-ar17wx.bitrix24.by";
    Token  = "6ad03969006e9f06006b12e400000001000...";
    ChatID = "3518";

    Directory = OPI_Bitrix24.GetChatFilesFolder(URL, ChatID, Token);
    FolderID  = Directory["result"]["ID"];

    UploadedFile = OPI_Bitrix24.UploadFileToFolder(URL, "Imortant doc.docx", File, FolderID, Token);
    FileID       = UploadedFile["result"]["ID"];

    Result = OPI_Bitrix24.SendFile(URL, ChatID, FileID, Description, Token);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint bitrix24 SendFile \
             --url "b24-ar17wx.bitrix24.by" \
             --chat "***" \
             --fileid 48482 \
             --description "Very important file" \
             --token "***"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint bitrix24 SendFile ^
             --url "b24-ar17wx.bitrix24.by" ^
             --chat "***" ^
             --fileid 48482 ^
             --description "Very important file" ^
             --token "***"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "result": {
  "FILES": {
   "upload48482": {
    "id": 48482,
    "chatId": "***",
    "date": {},
    "type": "file",
    "name": "Imortant doc.docx",
    "extension": "docx",
    "size": 24071,
    "image": false,
    "status": "done",
    "progress": 100,
    "authorId": 1,
    "authorName": "Антон Титовец",
    "urlPreview": "",
    "urlShow": "https://b24-ar17wx.bitrix24.by/bitrix/services/main/ajax.php?action=disk.api.file.download&SITE_ID=s1&humanRE=1&fileId=48482&exact=N&fileName=Imortant%20doc.docx",
    "urlDownload": "https://b24-ar17wx.bitrix24.by/bitrix/services/main/ajax.php?action=disk.api.file.download&SITE_ID=s1&humanRE=1&fileId=48482&exact=N&fileName=Imortant%20doc.docx",
    "viewerAttrs": {
     "viewer": "",
     "viewerType": "cloud-document",
     "src": "https://b24-ar17wx.bitrix24.by/bitrix/services/main/ajax.php?action=disk.api.file.download&SITE_ID=s1&humanRE=1&fileId=48482&exact=N&fileName=Imortant%20doc.docx",
     "viewerTypeClass": "BX.Disk.Viewer.UnifiedLinkItem",
     "viewerSeparateItem": true,
     "viewerExtension": "disk.viewer.unified-link-item",
     "objectId": "48482",
     "imChatId": "***",
     "title": "Imortant doc.docx",
     "unifiedLink": "https://b24-ar17wx.bitrix24.by/disk/file/eZ7SypglJvd5sADQGCSq",
     "actions": "[{\"type\":\"download\"},{\"type\":\"copyToMe\",\"text\":\"Сохранить на Диск\",\"action\":\"BXIM.disk.saveToDiskAction\",\"params\":{\"fileId\":\"48482\"},\"extension\":\"disk.viewer.actions\",\"buttonIconClass\":\"ui-btn-icon-cloud\"}]"
    },
    "mediaUrl": {
     "preview": {
      "250": ""
     }
    },
    "isTranscribable": false,
    "isVideoNote": false,
    "isVoiceNote": false
   }
  },
  "DISK_ID": [
   "***"
  ],
  "FILE_MODELS": {
   "upload48482": {
    "id": 48482,
    "name": "Imortant doc.docx",
    "createTime": {},
    "updateTime": {},
    "deleteTime": null,
    "code": null,
    "xmlId": null,
    "storageId": 6,
    "realObjectId": 48482,
    "parentId": 48478,
    "deletedType": 0,
    "createdBy": "1",
    "updatedBy": "1",
    "deletedBy": "0",
    "uniqueCode": "eZ7SypglJvd5sADQGCSq",
    "typeFile": 4,
    "globalContentVersion": 2,
    "fileId": 32900,
    "size": 24071,
    "etag": "e08ff077495935546a14540040680916",
    "links": {
     "download": "/bitrix/services/main/ajax.php?action=disk.file.download&SITE_ID=s1&fileId=48482",
     "showInGrid": "/bitrix/tools/disk/focus.php?objectId=48482&action=showObjectInGrid&ncc=1"
    }
   }
  },
  "MESSAGE_ID": 70484
 },
 "time": {
  "start": 1765396777,
  "finish": 1765396777.65031,
  "duration": 0.650312900543213,
  "processing": 0,
  "date_start": "2025-12-10T19:59:37+00:00",
  "date_finish": "2025-12-10T19:59:37+00:00",
  "operating_reset_at": 1765397377,
  "operating": 0
 }
}
```
