You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-27 22:18:36 +02:00
111 lines
3.4 KiB
Plaintext
Vendored
111 lines
3.4 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 9
|
|
description: Move 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';
|
|
|
|
# Move file
|
|
Move file from one destination to another
|
|
|
|
|
|
|
|
`Function MoveFileToFolder(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 | ✔ | File ID |
|
|
| FolderID | --folderid | String, Number | ✔ | ID of new 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.moveto](https://dev.1c-bitrix.ru/rest_help/disk/file/disk_file_moveto.php)
|
|
:::
|
|
<br/>
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
FolderID = "42176";
|
|
FileID = "42168";
|
|
|
|
URL = "https://b24-ar17wx.bitrix24.by/rest/1/h0m...";
|
|
|
|
Result = OPI_Bitrix24.MoveFileToFolder(URL, FileID, FolderID);
|
|
|
|
FolderID = "42178";
|
|
|
|
URL = "b24-ar17wx.bitrix24.by";
|
|
Token = "75d8c668006e9f06006b12e400000001000...";
|
|
|
|
Result = OPI_Bitrix24.MoveFileToFolder(URL, FileID, FolderID, Token);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
oint bitrix24 MoveFileToFolder \
|
|
--url "b24-ar17wx.bitrix24.by" \
|
|
--fileid 39110 \
|
|
--folderid 39120 \
|
|
--token "***"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint bitrix24 MoveFileToFolder ^
|
|
--url "b24-ar17wx.bitrix24.by" ^
|
|
--fileid 39110 ^
|
|
--folderid 39120 ^
|
|
--token "***"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"result": {
|
|
"ID": "42330",
|
|
"NAME": "New file name.jpg",
|
|
"CODE": null,
|
|
"STORAGE_ID": "3",
|
|
"TYPE": "file",
|
|
"PARENT_ID": 42340,
|
|
"DELETED_TYPE": "0",
|
|
"GLOBAL_CONTENT_VERSION": "1",
|
|
"FILE_ID": "28404",
|
|
"SIZE": "805189",
|
|
"CREATE_TIME": "2025-09-15T09:45:36+03:00",
|
|
"UPDATE_TIME": "2025-09-15T09:46:11+03:00",
|
|
"DELETE_TIME": "2025-09-15T09:46:10+03:00",
|
|
"CREATED_BY": "1",
|
|
"UPDATED_BY": "1",
|
|
"DELETED_BY": "1",
|
|
"DOWNLOAD_URL": "https://b24-ar17wx.bitrix24.by/rest/download.json?auth=b8c3c768006e9f06006b12e4000000010000077ef10e1d2738b7b2b7d4c5a8cb98228c&token=disk%7CaWQ9NDIzMzAmXz0xcU5zWDZNVWREUHR1a3dLNVdmaGJCUm5mcVhvVjZFNg%3D%3D%7CImRvd25sb2FkfGRpc2t8YVdROU5ESXpNekFtWHoweGNVNXpXRFpOVldSRVVIUjFhM2RMTlZkbWFHSkNVbTVtY1ZodlZqWkZOZz09fGI4YzNjNzY4MDA2ZTlmMDYwMDZiMTJlNDAwMDAwMDAxMDAwMDA3N2VmMTBlMWQyNzM4YjdiMmI3ZDRjNWE4Y2I5ODIyOGMi.huycruiYkHCWU4mtfUW4S3Tua8BubkazCkFm7wAmL%2F4%3D",
|
|
"DETAIL_URL": "https://b24-ar17wx.bitrix24.by/docs/file/New catalog/New subfolder/New file name.jpg"
|
|
},
|
|
"time": {
|
|
"start": 1757918779.25999,
|
|
"finish": 1757918779.32407,
|
|
"duration": 0.0640869140625,
|
|
"processing": 0.0386519432067871,
|
|
"date_start": "2025-09-15T09:46:19+03:00",
|
|
"date_finish": "2025-09-15T09:46:19+03:00",
|
|
"operating_reset_at": 1757919379,
|
|
"operating": 0
|
|
}
|
|
}
|
|
```
|