Send file
Send disk file to chat
- Parameters
- Advanced call ?
Function SendFile(Val URL, Val ChatID, Val FileID, Val Description = "", Val Token = "") Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| URL | --url | String | ✔ | URL of webhook or a Bitrix24 domain, when token used |
| ChatID | --chat | String, Number | ✔ | Chat ID |
| FileID | --fileid | String, Number | ✔ | File ID from UploadFileToFolder method |
| Description | --description | String | ✖ | File description |
| Token | --token | String | ✖ | Access token, when app auth method used |
Returns
Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
tip
Method at API documentation: im.disk.file.commit
1C:Enterprise/OneScript code example
URL = "https://b24-ar17wx.bitrix24.by/rest/1/av5...";
ChatID = "3390";
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 = "a5b00469006e9f06006b12e400000001000...";
ChatID = "3392";
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);
- Bash
- CMD/Bat
oint bitrix24 SendFile \
--url "b24-ar17wx.bitrix24.by" \
--chat "***" \
--fileid 57830 \
--description "Very important file" \
--token "***"
oint bitrix24 SendFile ^
--url "b24-ar17wx.bitrix24.by" ^
--chat "***" ^
--fileid 57830 ^
--description "Very important file" ^
--token "***"
Result
{
"result": {
"FILES": {
"upload57830": {
"id": 57830,
"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=s...",
"urlDownload": "https://b24-ar17wx.bitrix24.by/bitrix/services/main/ajax.php?action=disk.api.file.download&SITE_ID=s...",
"viewerAttrs": {
"viewer": "",
"viewerType": "cloud-document",
"src": "https://b24-ar17wx.bitrix24.by/bitrix/services/main/ajax.php?action=disk.api.file.download&SITE_ID=s...",
"viewerTypeClass": "BX.Disk.Viewer.UnifiedLinkItem",
"viewerSeparateItem": true,
"viewerExtension": "disk.viewer.unified-link-item",
"objectId": "57830",
"imChatId": "***",
"title": "Imortant doc.docx",
"unifiedLink": "https://b24-ar17wx.bitrix24.by/disk/file/5Djd5UznGFOujlW1mZOx",
"actions": "[{\"type\":\"download\"},{\"type\":\"copyToMe\",\"text\":\"Сохранить на Диск\",\"action\":\"BXIM.disk.saveToDiskAct..."
},
"mediaUrl": {
"preview": {
"250": ""
}
},
"isTranscribable": false,
"isVideoNote": false,
"isVoiceNote": false
}
},
"DISK_ID": [
"57830"
],
"FILE_MODELS": {
"upload57830": {
"id": 57830,
"name": "Imortant doc.docx",
"createTime": {},
"updateTime": {},
"deleteTime": null,
"code": null,
"xmlId": null,
"storageId": 6,
"realObjectId": 57830,
"parentId": 57826,
"deletedType": 0,
"createdBy": "1",
"updatedBy": "1",
"deletedBy": "0",
"uniqueCode": "5Djd5UznGFOujlW1mZOx",
"typeFile": 4,
"globalContentVersion": 2,
"fileId": 39870,
"size": 24071,
"etag": "9eacfcebc41ae83d91ea9e9154de777f",
"links": {
"download": "/bitrix/services/main/ajax.php?action=disk.file.download&SITE_ID=s1&fileId=57830",
"showInGrid": "/bitrix/tools/disk/focus.php?objectId=57830&action=showObjectInGrid&ncc=1"
}
}
},
"MESSAGE_ID": 94154
},
"time": {
"start": 1779804890,
"finish": 1779804890.75656,
"duration": 0.756556034088135,
"processing": 0,
"date_start": "2026-05-26T14:14:50+00:00",
"date_finish": "2026-05-26T14:14:50+00:00",
"operating_reset_at": 1779805490,
"operating": 0
}
}