2024-06-05 12:19:46 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 2
|
|
|
|
---
|
|
|
|
|
|
|
|
# Create folder
|
|
|
|
Creates a directory on the disk
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
`Function CreateFolder(Val Token, Val Path) Export`
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-08-13 14:52:26 +02:00
|
|
|
| Parameter | CLI option | Type | Description |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Token |
|
|
|
|
| Path | --path | String | Path to the created folder |
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-08-13 14:52:26 +02:00
|
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Yandex
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-07-10 13:05:58 +02:00
|
|
|
<br/>
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
```bsl title="Code example"
|
2024-08-13 15:47:32 +02:00
|
|
|
Token = "y0_AgAAAABdylaOAAs0QgAAAAD5i-a...";
|
|
|
|
Path = "/" + String(New UUID);
|
|
|
|
|
|
|
|
Result = OPI_YandexDisk.CreateFolder(Token, Path);
|
2024-06-05 12:19:46 +02:00
|
|
|
```
|
2024-08-13 14:52:26 +02:00
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
2024-08-13 14:52:26 +02:00
|
|
|
|
|
|
|
oint yadisk CreateFolder --token "y0_AgAAAABdylaOAAs0QgAAAAD5i-a..." --path %path%
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-08-14 08:06:31 +02:00
|
|
|
{
|
2024-08-13 14:52:26 +02:00
|
|
|
"revision": 1707461457546792,
|
|
|
|
"comment_ids": {
|
|
|
|
"public_resource": "1573541518:ba32b9efac79ab1b04707a4278a1ff583d7b0403ea306035f1b910e56c6ef3ac",
|
|
|
|
"private_resource": "1573541518:ba32b9efac79ab1b04707a4278a1ff583d7b0403ea306035f1b910e56c6ef3ac"
|
|
|
|
},
|
|
|
|
"path": "disk:/TestFolder",
|
|
|
|
"modified": "2024-02-09T06:50:57+00:00",
|
|
|
|
"created": "2024-02-09T06:50:57+00:00",
|
|
|
|
"resource_id": "1573541518:ba32b9efac79ab1b04707a4278a1ff583d7b0403ea306035f1b910e56c6ef3ac",
|
|
|
|
"type": "dir",
|
|
|
|
"name": "TestFolder",
|
|
|
|
"exif": {},
|
|
|
|
"_embedded": {
|
|
|
|
"total": 0,
|
|
|
|
"path": "disk:/TestFolder",
|
|
|
|
"limit": 20,
|
|
|
|
"offset": 0,
|
|
|
|
"items": [],
|
|
|
|
"sort": ""
|
|
|
|
}
|
|
|
|
}
|
2024-06-05 12:19:46 +02:00
|
|
|
```
|