Free and used space
To find out how much space is in use on Yandex.Disk and how much free space is left, send a PROPFIND request in any directory, specifying the corresponding properties in the request body:
quota-available-bytes
— Free space.quota-used-bytes
— Used space.
Request for the amount of free and used space:
PROPFIND / HTTP/1.1
Host: webdav.yandex.ru
Accept: */*
Depth: 0
Authorization: OAuth 0c4181a7c2cf4521964a72ff57a34a07
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:quota-available-bytes/>
<D:quota-used-bytes/>
</D:prop>
</D:propfind>
The service returns the requested properties, specifying the amount of free and used space on Yandex.Disk in bytes:
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset="utf-8"
Content-Length: 320
<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:">
<d:response>
<d:href>/</d:href>
<d:propstat>
<d:status>HTTP/1.1 200 OK</d:status>
<d:prop>
<d:quota-available-bytes>282476624607</d:quota-available-bytes>
<d:quota-used-bytes>4212442401</d:quota-used-bytes>
</d:prop>
</d:propstat>
</d:response>
</d:multistatus>