Attach file to the topic
Attaches a file to the selected task
Function AttachFileToTopic(Val URL, Val TaskID, Val FileID, Val Token = "") Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| URL | --url | String | ✔ | URL of webhook or a Bitrix24 domain, when token used |
| TaskID | --task | Number, String | ✔ | Task ID |
| FileID | --fileid | Number, String | ✔ | File ID |
| Token | --token | String | ✖ | Access token, when app auth method used |
Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
tip
Method at API documentation: tasks.task.files.attach
1C:Enterprise/OneScript code example
URL = "https://b24-ar17wx.bitrix24.by/rest/1/h0m...";
TaskID = "8618";
FileID = "46128";
Result = OPI_Bitrix24.AttachFileToTopic(URL, TaskID, FileID);
URL = "b24-ar17wx.bitrix24.by";
Token = "53100369006e9f06006b12e400000001000...";
TaskID = "8620";
Result = OPI_Bitrix24.AttachFileToTopic(URL, TaskID, FileID, Token);
- Bash
- CMD/Bat
oint bitrix24 AttachFileToTopic \
--url "b24-ar17wx.bitrix24.by" \
--task "8670" \
--fileid 46398 \
--token "***"
oint bitrix24 AttachFileToTopic ^
--url "b24-ar17wx.bitrix24.by" ^
--task "8670" ^
--fileid 46398 ^
--token "***"
Result
{
"result": {
"attachmentId": 13058
},
"time": {
"start": 1761911622,
"finish": 1761911623.04785,
"duration": 1.047847032547,
"processing": 0,
"date_start": "2025-10-31T11:53:42+00:00",
"date_finish": "2025-10-31T11:53:43+00:00",
"operating_reset_at": 1761912223,
"operating": 0
}
}