Skip to main content

Publish object

Publishes the disk object for public access

Function PublishObject(Val Token, Val Path) Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Path--pathStringPath to the object to be published

Returns: Map Of KeyAndValue - serialized JSON response from Yandex


1C:Enterprise/OneScript code example
    Token = "y0_AgAAAABdylaOAAs0QgAAAAD5i-a...";
Path = "/f228f0e9-5f02-4b1b-a823-97d6f85d8630.png";

Result = OPI_YandexDisk.PublishObject(Token, Path);
    oint yadisk PublishObject \
--token "***" \
--path "/7afb844a-b507-4f75-8151-bea843feea34.png"
Result
{
"path": "disk:/7afb844a-b507-4f75-8151-bea843feea34.png",
"type": "file",
"name": "7afb844a-b507-4f75-8151-bea843feea34.png",
"created": "2025-10-15T09:33:04+00:00",
"modified": "2025-10-15T09:33:04+00:00",
"size": 2114023,
"mime_type": "multipart",
"md5": "9e0176f87f6565a22f78e0f9b39a4d78",
"sha256": "89f8eb42a35208a17c85036e17237b0aa0657e1841efa6171dc5acbc0dea9e18",
"public_key": "K8r9bA/4cV8sB81g5pUyftvV5JaOGjX0u50X4BiCzwPCyu1y2zED45u2nlDdTleoq/J6bpmRyOJonT3VoXnDag==",
"public_url": "https://yadi.sk/d/Rj-2oP38HlVMFg",
"media_type": "image",
"resource_id": "1573541518:7186c69d32255b13aa60951b1ca0d150729b623d2cc6919f6fd80a0648fcfcdf",
"revision": 1760520805994816,
"comment_ids": {
"public_resource": "1573541518:7186c69d32255b13aa60951b1ca0d150729b623d2cc6919f6fd80a0648fcfcdf",
"private_resource": "1573541518:7186c69d32255b13aa60951b1ca0d150729b623d2cc6919f6fd80a0648fcfcdf"
},
"exif": {},
"antivirus_status": "clean",
"file": "https://downloader.disk.yandex.ru/disk/4b03193909ee5b86d7f9bf5880094006383c9d84d490b81c3794112c81cb2337/68efa2ac/Kdpe3dFisZLPovVA4r-aBmpkby3AOQiLsayEHYapOMw2ylFGSbZZrsWtGPTvHxG_-QDrqSGFBOOsS3b3gKT1zA%3D%3D?uid=1573541518&filename=7afb844a-b507-4f75-8151-bea843feea34.png&disposition=attachment&hash=&limit=0&content_type=multipart&owner_uid=1573541518&fsize=2114023&hid=03d7263840468e281bd0b238a26e7d0d&media_type=image&tknv=v3&etag=9e0176f87f6565a22f78e0f9b39a4d78"
}