Перейти к основному содержимому

Получить список файлов

Получает список файлов

Функция ПолучитьСписокФайлов(Знач Токен, Знач ИмяСодержит = "", Знач Каталог = "") Экспорт

ПараметрCLI опцияТипОбяз.Назначение
Токен--tokenСтрокаТокен
ИмяСодержит--queryСтрокаОтбор по имени
Каталог--catalogСтрокаОтбор по ID каталога родителя
Возвращаемое значение

Соответствие Из КлючИЗначение - Массив соответствий файлов

Пример использования для 1С:Предприятие/OneScript
Токен = "ya29.a0ATi6K2sWW_31WLH0d9aK0qk0HJ-UfyvZDcLeBbF5bLU7QH09Bx2pXAupIw40USQVaxXqsovItVSt9swWuPdBDSA0eFaVPE0CbaU2OLQlyrnITI1VVXgZ_Gx2R...";
Каталог = "root";
ИмяСодержит = "data";

Результат = OPI_GoogleDrive.ПолучитьСписокФайлов(Токен, ИмяСодержит, Каталог);
oint gdrive ПолучитьСписокФайлов \
--token "***" \
--query "data" \
--catalog "root"
Результат
[
{
"kind": "drive#file",
"fileExtension": "json",
"copyRequiresWriterPermission": false,
"md5Checksum": "0fc2d46d60243513dd25eaf76395c492",
"writersCanShare": true,
"viewedByMe": true,
"mimeType": "application/json",
"parents": [
"0AN2vrbrhqfJrUk9PVA"
],
"iconLink": "https://drive-thirdparty.googleusercontent.com/16/type/application/json",
"shared": false,
"lastModifyingUser": {
"displayName": "Антон Титовец",
"kind": "drive#user",
"me": true,
"permissionId": "07468399490707249352",
"emailAddress": "bayselonarrend@gmail.com",
"photoLink": "https://lh3.googleusercontent.com/a/ACg8ocKYttNv2CZ-cTTuE90Zmht_PwnGc0YnjM1IUllXsTVORfZFVPU=s64"
},
"owners": [
{
"displayName": "Антон Титовец",
"kind": "drive#user",
"me": true,
"permissionId": "07468399490707249352",
"emailAddress": "bayselonarrend@gmail.com",
"photoLink": "https://lh3.googleusercontent.com/a/ACg8ocKYttNv2CZ-cTTuE90Zmht_PwnGc0YnjM1IUllXsTVORfZFVPU=s64"
}
],
"headRevisionId": "0B92vrbrhqfJrNzhrT1BOQm5Nb3pxN05jYzA1dmZUd3B6bUxjPQ",
"webViewLink": "https://drive.google.com/file/d/1NKMmj4SJh3WUw74nhLuMofW7dfpUR520/view?usp=drivesdk",
"webContentLink": "https://drive.google.com/uc?id=1NKMmj4SJh3WUw74nhLuMofW7dfpUR520&export=download",
"size": "23665",
"viewersCanCopyContent": true,
"permissions": [
{
"id": "07468399490707249352",
"displayName": "Антон Титовец",
"type": "user",
"kind": "drive#permission",
"photoLink": "https://lh3.googleusercontent.com/a/ACg8ocKYttNv2CZ-cTTuE90Zmht_PwnGc0YnjM1IUllXsTVORfZFVPU=s64",
"emailAddress": "bayselonarrend@gmail.com",
"role": "owner",
"deleted": false,
"pendingOwner": false
}
],
"hasThumbnail": false,
"spaces": [
"drive"
],
"id": "1NKMmj4SJh3WUw74nhLuMofW7dfpUR520",
"name": "data.json",
"starred": false,
"trashed": false,
"explicitlyTrashed": false,
"createdTime": "2024-02-29T19:22:49.616Z",
"modifiedTime": "2026-05-02T09:21:25.709Z",
"modifiedByMeTime": "2026-05-02T09:21:25.709Z",
"viewedByMeTime": "2026-05-02T09:21:25.709Z",
"quotaBytesUsed": "23665",
"version": "24257",
"originalFilename": "***",
"ownedByMe": true,
"fullFileExtension": "json",
"isAppAuthorized": false,
"capabilities": {
"canChangeViewersCanCopyContent": true,
"canEdit": true,
"canCopy": true,
"canComment": true,
"canAddChildren": false,
"canDelete": true,
"canDownload": true,
"canListChildren": false,
"canRemoveChildren": false,
"canRename": true,
"canTrash": true,
"canReadRevisions": true,
"canChangeCopyRequiresWriterPermission": true,
"canMoveItemIntoTeamDrive": true,
"canUntrash": true,
"canModifyContent": true,
"canMoveItemOutOfDrive": true,
"canAddMyDriveParent": false,
"canRemoveMyDriveParent": true,
"canMoveItemWithinDrive": true,
"canShare": true,
"canMoveChildrenWithinDrive": false,
"canModifyContentRestriction": true,
"canChangeSecurityUpdateEnabled": false,
"canAcceptOwnership": false,
"canReadLabels": false,
"canModifyLabels": false,
"canModifyEditorContentRestriction": true,
"canModifyOwnerContentRestriction": true,
"canRemoveContentRestriction": false,
"canDisableInheritedPermissions": false,
"canEnableInheritedPermissions": true,
"canChangeItemDownloadRestriction": true,
"canStartApproval": false
},
"thumbnailVersion": "0",
"modifiedByMe": true,
"permissionIds": [
"07468399490707249352"
],
"linkShareMetadata": {
"securityUpdateEligible": false,
"securityUpdateEnabled": true
},
"sha1Checksum": "ea0a13537bc89ffeea2f6ee9677bf534464ab670",
"sha256Checksum": "eaf654471a6ba971f7b5fb2d57c300c8ea3d8b80e2f4801b1691e9dadb4a9a3f",
"inheritedPermissionsDisabled": false,
"downloadRestrictions": {
"itemDownloadRestriction": {
"restrictedForReaders": false,
"restrictedForWriters": false
},
"effectiveDownloadRestrictionWithContext": {
"restrictedForReaders": false,
"restrictedForWriters": false
}
},
"clientEncryptionDetails": {
"decryptionMetadata": {
"wrappedKey": "***",
"kaclsId": "0",
"aes256GcmChunkSize": "unset",
"keyFormat": "***",
"encryptionResourceKeyHash": "***"
}
}
}
]