Skip to main content

Move object

Moves the object to the specified path and path to the original

Function MoveObject(Val Token, Val Original, Val Path, Val Overwrite = False) Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Original--fromStringPath to the original file or folder
Path--toStringDestination path for moving
Overwrite--rewriteBooleanOverwrite if a file with the same name already exists

Returns: Map Of KeyAndValue - serialized JSON response from Yandex


1C:Enterprise/OneScript code example
    Token    = "y0_AgAAAABdylaOAAs0QgAAAAD5i-a...";
Original = "/3d240bed-234c-49de-9a6b-de98ceaf746b.png";
Path = "/" + String(New UUID) + ".png";

Result = OPI_YandexDisk.MoveObject(Token, Original, Path, True);
    oint yadisk MoveObject \
--token "***" \
--from "/3796dfda-db5d-4852-a95d-f537266c0756.png" \
--to "/50e4795d-236d-4dc1-a214-a193f544af24.png" \
--rewrite true
Result
{
"antivirus_status": "clean",
"size": 2114023,
"comment_ids": {
"private_resource": "1573541518:513349b18480e51184e963f68f6d0e8f4173c06c4ab885b65f0eb797138892f3",
"public_resource": "1573541518:513349b18480e51184e963f68f6d0e8f4173c06c4ab885b65f0eb797138892f3"
},
"name": "2a45ec48-94fd-4a39-a282-836b0177948a.png",
"exif": {},
"created": "2024-10-09T09:10:03+03:00",
"resource_id": "1573541518:513349b18480e51184e963f68f6d0e8f4173c06c4ab885b65f0eb797138892f3",
"modified": "2024-10-09T09:10:27+03:00",
"mime_type": "multipart",
"file": "https://downloader.disk.yandex.ru/disk/a0b2187a8a78f1e08b108c712034d22c1c5b1f8b7d82f2b5d0c84af4e7ddf460/67065694/gwThwhLBKYvLhQCNnqAHikawF6ofeh69S2Q-9g1T5IGPQ-vmmg5ho0UNlym1cYvMYt55yWUwrNHLEwnJN27VGg%3D%3D?uid=1573541518&filename=2a45ec48-94fd-4a39-a282-836b0177948a.png&disposition=attachment&hash=&limit=0&content_type=multipart&owner_uid=1573541518&fsize=2114023&hid=03d7263840468e281bd0b238a26e7d0d&media_type=image&tknv=v2&etag=9e0176f87f6565a22f78e0f9b39a4d78",
"path": "disk:/2a45ec48-94fd-4a39-a282-836b0177948a.png",
"media_type": "image",
"sha256": "89f8eb42a35208a17c85036e17237b0aa0657e1841efa6171dc5acbc0dea9e18",
"type": "file",
"md5": "9e0176f87f6565a22f78e0f9b39a4d78",
"revision": 1728454227592125
}