You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-25 22:12:29 +02:00
67 lines
1.8 KiB
Plaintext
Vendored
67 lines
1.8 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 5
|
|
description: Create folder and other functions to work with Google Drive 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, Google Drive]
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# Create folder
|
|
Creates an empty directory on the drive
|
|
|
|
|
|
|
|
`Function CreateFolder(Val Token, Val Name, Val Parent = "") Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| Token | --token | String | ✔ | Token |
|
|
| Name | --title | String | ✔ | Folder name |
|
|
| Parent | --catalog | String | ✖ | Parent |
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Google
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
Token = "ya29.a0AQQ_BDQ_0g6De1s1jLOYbrGQ43QDri_VRPre92E-_aUXJNk52_zY1j3A74665Q7FVMzsgnjqjKN14ljBwB0PlswTyjZlgxcBIDMnuqIbFLhH8Hcxc5NfKIOpS...";
|
|
Directory = "11Mo30odYPEtBBU_0OndFx5dz1kP7tu-Y";
|
|
Name = "TestFolder";
|
|
|
|
Result = OPI_GoogleDrive.CreateFolder(Token, Name, Directory);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
oint gdrive CreateFolder \
|
|
--token "***" \
|
|
--title "TestFolder"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint gdrive CreateFolder ^
|
|
--token "***" ^
|
|
--title "TestFolder"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"kind": "drive#file",
|
|
"id": "1ZCmvCVM6_Vgzjgy7iSZbPJ7O8lJ8p3q0",
|
|
"name": "TestFolder",
|
|
"mimeType": "application/vnd.google-apps.folder"
|
|
}
|
|
```
|