1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-04-15 11:56:36 +02:00

88 lines
2.6 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
sidebar_position: 8
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Copy file
Copy file from one destination to another
`Function MakeCopyFile(Val URL, Val FileID, Val FolderID, Val Token = "") Export`
2024-10-15 15:15:47 +03:00
| 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="Code example"
2024-10-15 10:07:27 +03:00
FolderID = "12880";
FileID = "12876";
2024-08-13 16:47:32 +03:00
2024-09-24 11:38:18 +03:00
URL = "https://b24-ar17wx.bitrix24.by/rest/1/1o2...";
2024-08-13 16:47:32 +03:00
Result = OPI_Bitrix24.MakeCopyFile(URL, FileID, FolderID);
2024-10-15 10:07:27 +03:00
FolderID = "12882";
2024-08-13 16:47:32 +03:00
2024-09-24 11:38:18 +03:00
URL = "b24-ar17wx.bitrix24.by";
2024-10-15 10:07:27 +03:00
Token = "21750a67006e9f06006b12e400000001000...";
2024-08-13 16:47:32 +03:00
Result = OPI_Bitrix24.MakeCopyFile(URL, FileID, FolderID, Token);
2024-09-24 22:46:18 +03:00
OPI_TestDataRetrieval.Check_BitrixObject(Result);
```
2024-10-15 09:53:37 +03:00
```json title="Result"
2024-08-14 09:06:31 +03:00
{
"result": {
2024-10-09 09:42:00 +03:00
"ID": 12604,
2024-08-14 09:06:31 +03:00
"NAME": "New file name.jpg",
"CODE": null,
"STORAGE_ID": "3",
"TYPE": "file",
2024-10-09 09:42:00 +03:00
"PARENT_ID": "12582",
2024-08-14 09:06:31 +03:00
"DELETED_TYPE": 0,
"GLOBAL_CONTENT_VERSION": 1,
2024-10-09 09:42:00 +03:00
"FILE_ID": 8678,
2024-08-14 09:06:31 +03:00
"SIZE": "805189",
2024-10-09 09:42:00 +03:00
"CREATE_TIME": "2024-10-09T09:20:28+03:00",
"UPDATE_TIME": "2024-10-09T09:20:28+03:00",
2024-08-14 09:06:31 +03:00
"DELETE_TIME": null,
"CREATED_BY": "1",
"UPDATED_BY": "1",
"DELETED_BY": null,
2024-10-09 09:42:00 +03:00
"DOWNLOAD_URL": "https://b24-ar17wx.bitrix24.by/rest/download.json?auth=6b2e0667006e9f06006b12e4000000010000072c4914d2a629a27f8e468fd6a8ba64ff&token=disk%7CaWQ9MTI2MDQmXz1ka3Jhc2tOdTFzMTNFR2lWMkxlRXhVaGhpRXNZNHJIeg%3D%3D%7CImRvd25sb2FkfGRpc2t8YVdROU1USTJNRFFtWHoxa2EzSmhjMnRPZFRGek1UTkZSMmxXTWt4bFJYaFZhR2hwUlhOWk5ISkllZz09fDZiMmUwNjY3MDA2ZTlmMDYwMDZiMTJlNDAwMDAwMDAxMDAwMDA3MmM0OTE0ZDJhNjI5YTI3ZjhlNDY4ZmQ2YThiYTY0ZmYi.N%2FF9rbooZHbXWXkg%2FNRXmmAOWkTJnKmwua3QXnjg12Y%3D",
2024-08-14 09:06:31 +03:00
"DETAIL_URL": "https://b24-ar17wx.bitrix24.by/docs/file/New catalog/New file name.jpg"
},
"time": {
2024-10-09 09:42:00 +03:00
"start": 1728454828.44084,
"finish": 1728454828.53669,
"duration": 0.0958428382873535,
"processing": 0.0711829662322998,
"date_start": "2024-10-09T09:20:28+03:00",
"date_finish": "2024-10-09T09:20:28+03:00",
"operating_reset_at": 1728455428,
2024-08-14 09:06:31 +03:00
"operating": 0
}
}
```