Get list of files
Gets the list of files
- Parameters
- Advanced call ?
Function GetFilesList(Val Token, Val NameContains = "", Val Directory = "") Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Token | --token | String | ✔ | Token |
| NameContains | --query | String | ✖ | Filter by name |
| Directory | --catalog | String | ✖ | Filter by parent directory ID |
Returns
Map Of KeyAndValue - Array of file mappings
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
1C:Enterprise/OneScript code example
Token = "ya29.a0ATi6K2sWW_31WLH0d9aK0qk0HJ-UfyvZDcLeBbF5bLU7QH09Bx2pXAupIw40USQVaxXqsovItVSt9swWuPdBDSA0eFaVPE0CbaU2OLQlyrnITI1VVXgZ_Gx2R...";
Directory = "root";
NameContains = "data";
Result = OPI_GoogleDrive.GetFilesList(Token, NameContains, Directory);
- Bash
- CMD/Bat
oint gdrive GetFilesList \
--token "***" \
--query "data" \
--catalog "root"
oint gdrive GetFilesList ^
--token "***" ^
--query "data" ^
--catalog "root"
Result
[
{
"kind": "drive#file",
"fileExtension": "json",
"copyRequiresWriterPermission": false,
"md5Checksum": "4391bc3d0c31c3db3cfa685f076ec86c",
"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": "0B92vrbrhqfJrM1JvWE04UHVxL0cwd3VINVBWUy9vcURPK3I4PQ",
"webViewLink": "https://drive.google.com/file/d/1NKMmj4SJh3WUw74nhLuMofW7dfpUR520/view?usp=drivesdk",
"webContentLink": "https://drive.google.com/uc?id=1NKMmj4SJh3WUw74nhLuMofW7dfpUR520&export=download",
"size": "23711",
"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-26T14:03:54.672Z",
"modifiedByMeTime": "2026-05-26T14:03:54.672Z",
"viewedByMeTime": "2026-05-26T14:03:54.672Z",
"quotaBytesUsed": "23711",
"version": "26702",
"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": "38196e1dbccce6c2da75af89a34eaa74544e9282",
"sha256Checksum": "d35049acdd5822ef317ccb1d15e9740573e657d25b8fedebffaec98f3bb42ef4",
"inheritedPermissionsDisabled": false,
"downloadRestrictions": {
"itemDownloadRestriction": {
"restrictedForReaders": false,
"restrictedForWriters": false
},
"effectiveDownloadRestrictionWithContext": {
"restrictedForReaders": false,
"restrictedForWriters": false
}
},
"clientEncryptionDetails": {
"decryptionMetadata": {
"wrappedKey": "***",
"kaclsId": "0",
"aes256GcmChunkSize": "unset",
"keyFormat": "***",
"encryptionResourceKeyHash": "***"
}
}
}
]