Creating a folder
To create a folder on Yandex.Disk, specify the desired path to the new folder.
Request format
Use the PUT method to send the request to create a folder.
https://cloud-api.yandex.net/v1/disk/resources
? path=<path to the created folder>
& [fields=<properties to include in the response>]
path * | The path to the folder being created. For example, to create a The path in the parameter value should be URL-encoded. |
fields | List of JSON keys to include in the response. Keys that are not included in this list will be discarded when forming the response. If the parameter is omitted, the response is returned in full, without discarding anything. Key names should be comma-separated, and embedded keys should be separated by dots. For example: |
path * | The path to the folder being created. For example, to create a The path in the parameter value should be URL-encoded. |
fields | List of JSON keys to include in the response. Keys that are not included in this list will be discarded when forming the response. If the parameter is omitted, the response is returned in full, without discarding anything. Key names should be comma-separated, and embedded keys should be separated by dots. For example: |
* Required
Response format
If the request was processed without errors, the API responds with the code 201 Created
(the folder was created successfully). The response body contains a link to metainformation about the created resource in the Link object.
If an error occurred during processing, the appropriate response code is returned, and the response body contains the error description.
Sample response:
{
"href": "https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FMusic",
"method": "GET",
"templated": false
}
Element | Description |
---|---|
href | URL. It may be a URL template; see the |
method | The HTTP method for requesting the URL from the |
templated | Indicates a URL template according to RFC 6570. Possible values:
|
Element | Description |
---|---|
href | URL. It may be a URL template; see the |
method | The HTTP method for requesting the URL from the |
templated | Indicates a URL template according to RFC 6570. Possible values:
|