You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-27 22:18:36 +02:00
110 lines
3.4 KiB
Plaintext
Vendored
110 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 = "43604";
|
|
FileID = "43596";
|
|
|
|
URL = "https://b24-ar17wx.bitrix24.by/rest/1/h0m...";
|
|
|
|
Result = OPI_Bitrix24.MoveFileToFolder(URL, FileID, FolderID);
|
|
|
|
FolderID = "43606";
|
|
|
|
URL = "b24-ar17wx.bitrix24.by";
|
|
Token = "c866e568006e9f06006b12e400000001000...";
|
|
|
|
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 43410 \
|
|
--folderid 43420 \
|
|
--token "***"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint bitrix24 MoveFileToFolder ^
|
|
--url "b24-ar17wx.bitrix24.by" ^
|
|
--fileid 43410 ^
|
|
--folderid 43420 ^
|
|
--token "***"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"result": {
|
|
"ID": "43410",
|
|
"NAME": "New file name.jpg",
|
|
"CODE": null,
|
|
"STORAGE_ID": "3",
|
|
"TYPE": "file",
|
|
"PARENT_ID": 43420,
|
|
"DELETED_TYPE": "0",
|
|
"GLOBAL_CONTENT_VERSION": "1",
|
|
"FILE_ID": "29212",
|
|
"SIZE": "805189",
|
|
"CREATE_TIME": "2025-10-07T14:48:26+00:00",
|
|
"UPDATE_TIME": "2025-10-07T14:49:13+00:00",
|
|
"DELETE_TIME": "2025-10-07T14:49:08+00:00",
|
|
"CREATED_BY": "1",
|
|
"UPDATED_BY": "1",
|
|
"DELETED_BY": "1",
|
|
"DOWNLOAD_URL": "https://b24-ar17wx.bitrix24.by/rest/download.json?auth=0d35e568006e9f06006b12e400000001000007c64edc3ff8cf376c3447f3b8be057a33&token=disk%7CaWQ9NDM0MTAmXz02aDFydU45MlJKQzN5M1BWVWlvN2JWUEJGQ3lOM0U0cA%3D%3D%7CImRvd25sb2FkfGRpc2t8YVdROU5ETTBNVEFtWHowMmFERnlkVTQ1TWxKS1F6TjVNMUJXVldsdk4ySldVRUpHUTNsT00wVTBjQT09fDBkMzVlNTY4MDA2ZTlmMDYwMDZiMTJlNDAwMDAwMDAxMDAwMDA3YzY0ZWRjM2ZmOGNmMzc2YzM0NDdmM2I4YmUwNTdhMzMi.Z9kRDZr0escMowkRGvob0Raaqntxlt%2BMcN3pb43LR%2FA%3D",
|
|
"DETAIL_URL": "https://b24-ar17wx.bitrix24.by/docs/file/New catalog/New subfolder/New file name.jpg"
|
|
},
|
|
"time": {
|
|
"start": 1759848585,
|
|
"finish": 1759848585.97565,
|
|
"duration": 0.975649118423462,
|
|
"processing": 0,
|
|
"date_start": "2025-10-07T14:49:45+00:00",
|
|
"date_finish": "2025-10-07T14:49:45+00:00",
|
|
"operating_reset_at": 1759849185,
|
|
"operating": 0
|
|
}
|
|
}
|
|
```
|