1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-27 22:18:36 +02:00
Files
OpenIntegrations/docs/en/md/Bitrix24/File-management/Make-file-copy.mdx
Vitaly the Alpaca (bot) 84bd7e0360 Main build (Jenkins)
2025-10-15 14:32:00 +03:00

110 lines
3.3 KiB
Plaintext
Vendored

---
sidebar_position: 8
description: Copy 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';
# Copy file
Copy file from one destination to another
`Function MakeFileCopy(Val URL, Val FileID, Val FolderID, Val Token = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| URL | --url | String | ✔ | URL of webhook or a Bitrix24 domain, when token used |
| FileID | --fileid | String, Number | ✔ | Original file ID |
| FolderID | --folderid | String, Number | ✔ | ID of copy destination folder |
| Token | --token | String | ✖ | Access token, when app auth method used |
Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
<br/>
:::tip
Method at API documentation: [disk.file.copyto](https://dev.1c-bitrix.ru/rest_help/disk/file/disk_file_copyto.php)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
FolderID = "44680";
FileID = "44676";
URL = "https://b24-ar17wx.bitrix24.by/rest/1/h0m...";
Result = OPI_Bitrix24.MakeFileCopy(URL, FileID, FolderID);
FolderID = "44682";
URL = "b24-ar17wx.bitrix24.by";
Token = "8a1bee68006e9f06006b12e400000001000...";
Result = OPI_Bitrix24.MakeFileCopy(URL, FileID, FolderID, Token);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint bitrix24 MakeFileCopy \
--url "b24-ar17wx.bitrix24.by" \
--fileid 44946 \
--folderid 44952 \
--token "***"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint bitrix24 MakeFileCopy ^
--url "b24-ar17wx.bitrix24.by" ^
--fileid 44946 ^
--folderid 44952 ^
--token "***"
```
</TabItem>
</Tabs>
```json title="Result"
{
"result": {
"ID": 44968,
"NAME": "New file name.jpg",
"CODE": null,
"STORAGE_ID": "3",
"TYPE": "file",
"PARENT_ID": "44952",
"DELETED_TYPE": 0,
"GLOBAL_CONTENT_VERSION": 1,
"FILE_ID": 30312,
"SIZE": "805189",
"CREATE_TIME": "2025-10-15T09:55:12+00:00",
"UPDATE_TIME": "2025-10-15T09:55:12+00:00",
"DELETE_TIME": null,
"CREATED_BY": "1",
"UPDATED_BY": "1",
"DELETED_BY": null,
"DOWNLOAD_URL": "https://b24-ar17wx.bitrix24.by/rest/download.json?auth=db7bef68006e9f06006b12e4000000010000076501c07fbfd408f751025f2a26e8fbc9&token=disk%7CaWQ9NDQ5NjgmXz15M25IbHJSUHJBRlJLN1NsZkhhS1lyQVF5U3A5YnNqRw%3D%3D%7CImRvd25sb2FkfGRpc2t8YVdROU5EUTVOamdtWHoxNU0yNUliSEpTVUhKQlJsSkxOMU5zWmtoaFMxbHlRVkY1VTNBNVluTnFSdz09fGRiN2JlZjY4MDA2ZTlmMDYwMDZiMTJlNDAwMDAwMDAxMDAwMDA3NjUwMWMwN2ZiZmQ0MDhmNzUxMDI1ZjJhMjZlOGZiYzki.6CdVHlH2VDk2UKUQ6xu3zSo2oauDP9890VWbCzX%2Bm3E%3D",
"DETAIL_URL": "https://b24-ar17wx.bitrix24.by/docs/file/New catalog/New file name.jpg"
},
"time": {
"start": 1760522112,
"finish": 1760522113.02256,
"duration": 1.02255892753601,
"processing": 1,
"date_start": "2025-10-15T09:55:12+00:00",
"date_finish": "2025-10-15T09:55:13+00:00",
"operating_reset_at": 1760522712,
"operating": 0
}
}
```