Skip to main content

Get list of directories

Gets the list of drive directories

Function GetDirectoriesList(Val Token, Val NameContains = "", Val Detailed = False) Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
NameContains--queryStringFilter by name
Detailed--depthBooleanAdds a list of files to the directory fields
Returns

Map Of KeyAndValue - Array of directory mappings

1C:Enterprise/OneScript code example
Name = "TestFolder";
Token = "ya29.a0ATi6K2sWW_31WLH0d9aK0qk0HJ-UfyvZDcLeBbF5bLU7QH09Bx2pXAupIw40USQVaxXqsovItVSt9swWuPdBDSA0eFaVPE0CbaU2OLQlyrnITI1VVXgZ_Gx2R...";

Result = OPI_GoogleDrive.GetDirectoriesList(Token, Name, True);
oint gdrive GetDirectoriesList \
--token "***" \
--query "TestFolder" \
--depth true
Result
{
"kind": "drive#file",
"copyRequiresWriterPermission": false,
"writersCanShare": true,
"viewedByMe": true,
"mimeType": "application/vnd.google-apps.folder",
"parents": [
"0AN2vrbrhqfJrUk9PVA"
],
"iconLink": "https://drive-thirdparty.googleusercontent.com/16/type/application/vnd.google-apps.folder",
"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"
}
],
"webViewLink": "https://drive.google.com/drive/folders/1T61ve0vc7hRiV8RYiMcBqR0GH3umkYDN",
"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"
],
"folderColorRgb": "#8f8f8f",
"id": "1T61ve0vc7hRiV8RYiMcBqR0GH3umkYDN",
"name": "TestFolder",
"starred": false,
"trashed": false,
"explicitlyTrashed": false,
"createdTime": "2026-02-07T12:48:08.163Z",
"modifiedTime": "2026-02-07T12:48:09.41Z",
"modifiedByMeTime": "2026-02-07T12:48:09.41Z",
"viewedByMeTime": "2026-02-07T12:48:08.163Z",
"quotaBytesUsed": "0",
"version": "1",
"ownedByMe": true,
"isAppAuthorized": false,
"capabilities": {
"canChangeViewersCanCopyContent": false,
"canEdit": true,
"canCopy": false,
"canComment": true,
"canAddChildren": true,
"canDelete": true,
"canDownload": true,
"canListChildren": true,
"canRemoveChildren": true,
"canRename": true,
"canTrash": true,
"canReadRevisions": false,
"canChangeCopyRequiresWriterPermission": false,
"canMoveItemIntoTeamDrive": true,
"canUntrash": true,
"canModifyContent": true,
"canMoveItemOutOfDrive": true,
"canAddMyDriveParent": false,
"canRemoveMyDriveParent": true,
"canMoveItemWithinDrive": true,
"canShare": true,
"canMoveChildrenWithinDrive": true,
"canModifyContentRestriction": false,
"canChangeSecurityUpdateEnabled": false,
"canAcceptOwnership": false,
"canReadLabels": false,
"canModifyLabels": false,
"canModifyEditorContentRestriction": false,
"canModifyOwnerContentRestriction": false,
"canRemoveContentRestriction": false,
"canDisableInheritedPermissions": true,
"canEnableInheritedPermissions": true,
"canChangeItemDownloadRestriction": false,
"canStartApproval": false
},
"thumbnailVersion": "0",
"modifiedByMe": true,
"permissionIds": [
"07468399490707249352"
],
"linkShareMetadata": {
"securityUpdateEligible": false,
"securityUpdateEnabled": true
},
"inheritedPermissionsDisabled": false,
"downloadRestrictions": {
"itemDownloadRestriction": {
"restrictedForReaders": false,
"restrictedForWriters": false
},
"effectiveDownloadRestrictionWithContext": {
"restrictedForReaders": false,
"restrictedForWriters": false
}
},
"clientEncryptionDetails": {
"decryptionMetadata": {}
},
"files": []
}