1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-25 22:12:29 +02:00
Files
OpenIntegrations/docs/en/md/GoogleDrive/File-and-directory-management/Create-folder.mdx
Vitaly the Alpaca (bot) cdef2d02ab Main build (Jenkins)
2025-10-21 21:43:05 +03:00

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_BDTEToh-GItDaON1RKItxn8oyyucs96C7wzRz-nN6Qcr3d7C5ogtN18HBpUDAewZxDbcc3jAtrj2aIO0zuU4KLYSMRkyFoLt8ZuczyuBGNtxdl-3opaY1...";
Directory = "191iyaa6-2BCNRPOF0F8mQ0TuNWPNesdM";
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"
}
```