-
Notifications
You must be signed in to change notification settings - Fork 483
Users Drive Comments
<DomainName> ::= <String>(.<String>)+
<EmailAddress> ::= <String>@<DomainName>
<UniqueID> ::= id:<String>
<UserItem> ::= <EmailAddress>|<UniqueID>|<String>
<CommentsAuthorSubfieldName> ::=
author.displayname|
author.emailaddress|
author.me|
author.permissionid|
author.photolink
<CommentsRepliesSubfieldName> ::=
reply.action|
reply.author|
reply.author.<CommentsAuthorSubfieldName>|
reply.content|
reply.createddate|createdtime|
reply.deleted|
reply.htmlcontent|
reply.id|
reply.modifieddate|modifiedtime
<CommentsFieldName> ::=
action|
author|
content|
<CommentsAuthorSubfieldName>|
<CommentsRepliesSubfieldName>|
createddate|createdtime|
deleted|
htmlcontent|
id|
modifieddate|modifiedtime|
quotedfilecontent|
reply|replies|
resolved
<CommentsFieldNameList> ::= "<CommentsFieldName>(,<CommentsFieldName>)*"
gam <UserTypeEntity> show filecomments <DriveFileEntity>
[showdeleted] [start <Date>|<Time>]
[fields <CommentsFieldNameList>] [showphotolinks]
[countsonly|positivecountsonly]
[formatjson]
Use my_commentable_items
for <DriveFileEntity>
to query only for files that can have comments.
By default, all non-deleted comments for a file are displayed; use these options to modify that behavior.
-
showdeleted
- Display deleted comments -
start <Date>|<Time>
- Display comments modified on or after<Date>|<Time>
By default, all comment and reply fields except author photolinks are displayed; use these options to modify that behavior.
-
fields <CommentsFieldNameList>
- Select fields to display -
showphotolinks
- Display author photolinks -
countsonly
- Display just the number of comments and replies; no fields -
positivecountsonly
- Display just the number of comments and replies only for files that have comments; no fields
By default, Gam displays the information as an indented list of keys and values.
-
formatjson
- Display the fields in JSON format.
Each comment/reply pair is output on a separate CSV file row.
gam <UserTypeEntity> print filecomments <DriveFileEntity> [todrive <ToDriveAttribute>*]
[showdeleted] [start <Date>|<Time>] [countsonly|positivecountsonly]
[fields <CommentsFieldNameList>] [showphotolinks]
(addcsvdata <FieldName> <String>)*
[formatjson [quotechar <Character>]]
Use my_commentable_items
for <DriveFileEntity>
to query only for files that can have comments.
By default, all non-deleted comments for a file are displayed; use these options to modify that behavior. Files with no comments will not be displayed.
-
showdeleted
- Display deleted comments -
start <Date>|<Time>
- Display comments modified on or after<Date>|<Time>
By default, all comment and reply fields except author photolinks are displayed; use these options to modify that behavior.
-
fields <CommentsFieldNameList>
- Select fields to display -
showphotolinks
- Display author photolinks -
countsonly
- Display just the number of comments and replies; no fields. Files with no comments will display zero counts. -
positivecountsonly
- Display just the number of comments and replies only for files that have comments; no fields
Add additional columns of data from the command line to the output:
addcsvdata <FieldName> <String>
By default, when writing CSV files, Gam uses a quote character of double quote "
. The quote character is used to enclose columns that contain
the quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled.
When using the formatjson
option, double quotes are used extensively in the data resulting in hard to read/process output.
The quotechar <Character>
option allows you to choose an alternate quote character, single quote for instance, that makes for readable/processable output.
quotechar
defaults to gam.cfg/csv_output_quote_char
. When uploading CSV files to Google, double quote "
should be used.
# Get files that may have comments
$ gam redirect csv ./CheckForComments.csv user [email protected] print filelist showmimetype gdoc,gpresentation,gsheet fields id,name,mimetype
Getting all Drive Files/Folders that match query ('me' in owners and (mimeType = 'application/vnd.google-apps.presentation' or mimeType = 'application/vnd.google-apps.spreadsheet' or mimeType = 'application/vnd.google-apps.document')) for [email protected]
Got 131 Drive Files/Folders that matched query ('me' in owners and (mimeType = 'application/vnd.google-apps.presentation' or mimeType = 'application/vnd.google-apps.spreadsheet' or mimeType = 'application/vnd.google-apps.document')) for [email protected]...
# Display file comments
$ gam redirect csv ./FilesWithComments.csv multiprocess csv CheckForComments.csv gam user "~Owner" print filecomments "~id" addcsvdata fileName "~name" addcsvdata mimeType "~mimeType" fields author.displayName,author.me,content,createdTime,deleted,modifiedTime,resolved,reply.author.displayName,reply.author.me,reply.content,reply.createdTime,reply.deleted,reply.modifiedTime
2024-03-24T08:04:46.235-07:00,0/131,Using 10 processes...
2024-03-24T08:04:58.122-07:00,0,Processing item 100/131
2024-03-24T08:05:01.345-07:00,0,Processing item 131/131
2024-03-24T08:07:11.731-07:00,0/131,Processing complete
$ more FilesWithCommnts.csv
User,fileId,fileName,mimeType,commentId,replyId,author.displayName,author.me,content,createdTime,deleted,modifiedTime,resolved,reply.author.displayName,reply.author.me,reply.content,reply.createdTime,reply.deleted,reply.modifiedTime
[email protected],xxx,TS Doc,application/vnd.google-apps.document,AAABJFedwm0,,Test-Simple,True,XXX Comment,2024-03-14T11:34:39-07:00,False,2024-03-14T11:34:39-07:00,False,,,,,,
[email protected],xxx,TS Doc,application/vnd.google-apps.document,AAABJFedwkw,,Test-Simple,True,Grack Comment,2024-03-14T11:26:30-07:00,False,2024-03-14T11:26:30-07:00,False,,,,,,
[email protected],xxx,TS Doc,application/vnd.google-apps.document,AAABJFedwkY,,Test-Simple,True,Again commnt,2024-03-14T11:24:13-07:00,False,2024-03-14T11:24:13-07:00,False,,,,,,
[email protected],xxx,TS Doc,application/vnd.google-apps.document,AAABJFedwkQ,,Test-Simple,True,More Comment,2024-03-14T11:23:48-07:00,False,2024-03-14T11:23:48-07:00,False,,,,,,
[email protected],xxx,TS Doc,application/vnd.google-apps.document,AAABJFedwkA,,Test-Simple,True,Comment 8,2024-03-14T11:23:14-07:00,False,2024-03-14T11:34:01-07:00,False,,,,,,
[email protected],xxx,TS Doc,application/vnd.google-apps.document,AAABJFedwj4,,Test-Simple,True,Comment 7,2024-03-14T11:23:05-07:00,False,2024-03-14T11:23:05-07:00,False,,,,,,
[email protected],xxx,TS Doc,application/vnd.google-apps.document,AAABJFedwj0,,Test-Simple,True,Comment 6,2024-03-14T11:22:55-07:00,False,2024-03-14T11:22:55-07:00,False,,,,,,
[email protected],xxx,TS Doc,application/vnd.google-apps.document,AAABJFedwjs,,Test-Simple,True,Comment 5,2024-03-14T11:22:38-07:00,False,2024-03-14T11:22:38-07:00,False,,,,,,
[email protected],xxx,TS Doc,application/vnd.google-apps.document,AAABJFedwjo,,Test-Simple,True,Comment 4,2024-03-14T11:22:19-07:00,False,2024-03-14T11:22:19-07:00,False,,,,,,
[email protected],xxx,TS Doc,application/vnd.google-apps.document,AAABJFedtKQ,,Test-Simple,True,End Comment,2024-03-14T10:32:16-07:00,False,2024-03-14T10:32:16-07:00,False,,,,,,
[email protected],xxx,TS Doc,application/vnd.google-apps.document,AAABJFedtKI,AAABJFedwik,Test-Simple,True,My first comment,2024-03-14T10:32:03-07:00,False,2024-03-14T11:15:05-07:00,False,Test-Simple,True,My first reply,2024-03-14T11:14:13-07:00,False,2024-03-14T11:14:13-07:00
[email protected],xxx,TS Doc,application/vnd.google-apps.document,AAABJFedtKI,AAABJFedwiw,Test-Simple,True,My first comment,2024-03-14T10:32:03-07:00,False,2024-03-14T11:15:05-07:00,False,Test-Simple,True,Yet another reply,2024-03-14T11:15:05-07:00,False,2024-03-14T11:15:05-07:00
[email protected],yyy,TS Sheet,application/vnd.google-apps.spreadsheet,AAABJM6zbc0,,Test-Simple,True,Sheet Comment,2024-03-14T20:43:18-07:00,False,2024-03-14T20:43:18-07:00,False,,,,,,
[email protected],zzz,TS Pres,application/vnd.google-apps.presentation,AAABJLy5DpA,,Test-Simple,True,Presentation Comment,2024-03-14T20:42:48-07:00,False,2024-03-14T20:42:48-07:00,False,,,,,,
$ gam redirect csv ./FilesWithComments.csv multiprocess csv CheckForComments.csv gam user "~Owner" print filecomments "~id" addcsvdata fileName "~name" addcsvdata mimeType "~mimeType" fields author.displayName,author.me,content,createdTime,deleted,modifiedTime,resolved,reply.author.displayName,reply.author.me,reply.content,reply.createdTime,reply.deleted,,reply.modifiedTime
2024-03-24T08:04:46.235-07:00,0/131,Using 10 processes...
2024-03-24T08:04:58.122-07:00,0,Processing item 100/131
2024-03-24T08:05:01.345-07:00,0,Processing item 131/131
2024-03-24T08:07:11.731-07:00,0/131,Processing complete
# Display file comment counts
$ gam redirect csv ./FileCommentCounts.csv multiprocess csv CheckForComments.csv gam user "~Owner" print filecomments "~id" addcsvdata fileName "~name" addcsvdata mimeType "~mimeType" countsonly
2024-03-24T07:51:16.881-07:00,0/131,Using 10 processes...
2024-03-24T07:51:28.909-07:00,0,Processing item 100/131
2024-03-24T07:51:32.241-07:00,0,Processing item 131/131
2024-03-24T07:51:37.404-07:00,0/131,Processing complete
$ more FileCommentCounts.csv
User,fileId,fileName,mimeType,comments,replies
...
[email protected],yyy,TS Sheet,application/vnd.google-apps.spreadsheet,1,0
[email protected],aaa,ViewTest,application/vnd.google-apps.document,0,0
[email protected],xxx,TS Doc,application/vnd.google-apps.document,11,2
[email protected],zzz,TS Pres,application/vnd.google-apps.presentation,1,0
...
Need more help? Ask on the GAM Discussion Group or Chat Space.
You can suggest edits to these Wiki pages by submitting pull requests against the wiki files.
oUpdate History
Installation
- How to Install GAM7
- How to Upgrade GAMADV-XTD3 to GAM7
- How to Upgrade Legacy GAM to GAM7
- How to Update GAM7
- Verifying a GAM7 Build is Legitimate and Official
- Install GAM as Python Library
- GAM7 on Chrome OS Devices
- GAM7 on Android Devices
- Google Network Addresses
- HTTPS Proxy
- SSL Root CA Certificates
- How to Uninstall GAM7
Configuration
- Authorization
- GAM Configuration
- Running GAM7 securely on a Google Compute Engine
- Using GAM7 with a delegated admin service account
- Using GAM7 with a YubiKey
- GAM with minimal GCP rights
Notes and Information
- Upgrade Benefits
- Questions? Visit the GAM Discussion Forum
- GAM Public Chat Room
- Scripts
- Other Resources
- Drive REST API v3
- BNF Syntax
- GAM Return Codes
- Python Regular Expressions
- Rclone
Definitions
Command Processing
- Bulk Processing
- Command Line Parsing
- Command Logging and Progress
- Command data from Google Docs/Sheets/Storage
- CSV Special Characters
- CSV Input Filtering
- CSV Output Filtering
- Meta Commands and File Redirection
- Permission matches
- Tag Replace
- Todrive
Collections
Client Access
- Addresses
- Administrators
- Alert Center
- Aliases
- Calendars
- Calendars - Access
- Calendars - Events
- Chrome Auto Update Expiration Counts
- Chrome Browser Cloud Management
- Chrome Device Needs Attention Counts
- Chrome Installed Apps
- Chrome Policies
- Chrome Printers
- Chrome Profile Management
- Chrome Version Counts
- Chrome Version History
- ChromeOS Devices
- Classroom - Courses
- Classroom - Guardians
- Classroom - Invitations
- Classroom - Membership
- Cloud Channel
- Cloud Identity Devices
- Cloud Identity Groups
- Cloud Identity Groups - Membership
- Cloud Identity Policies
- Cloud Storage
- Context Aware Access Levels
- Customer
- Domains
- Domains - Verification
- Domain People - Contacts & Profiles
- Domain Shared Contacts
- Email Audit Monitor
- Find File Owner
- Google Data Transfers
- Groups
- Groups - Membership
- Inbound SSO
- Licenses
- Mobile Devices
- Organizational Units
- Reports
- Reseller
- Resources
- Send Email
- Schemas
- Shared Drives
- Sites
- Unmanaged Accounts
- Users
- Users - Application Specific Passwords
- Users - Backup Verification Codes
- Users - Classroom - Profile
- Users - Contacts - Delegates
- Users - Deprovision
- Users - Group Membership
- Users - Photo
- Users - Profile Sharing
- Users - Signout and Turn off 2-Step Verification
- Users - Tokens
- Vault - Takeout
- Version and Help
Special Service Account Access
Service Account Access
- Users - Analytics Admin
- Users - Calendars
- Users - Calendars - Access
- Users - Calendars - Events
- Users - Chat
- Users - Classification Labels
- Users - Contacts
- Users - Drive - File Selection
- Users - Drive - Activity/Settings
- Users - Drive - Cleanup
- Users - Drive - Comments
- Users - Drive - Copy/Move
- Users - Drive - Files-Display
- Users - Drive - Files-Manage
- Users - Drive - Orphans
- Users - Drive - Ownership
- Users - Drive - Permissions
- Users - Drive - Query
- Users - Drive - Revisions
- Users - Drive - Shortcuts
- Users - Drive - Transfer
- Users - Forms
- Users - Gmail - Client Side Encryption
- Users - Gmail - Delegates
- Users - Gmail - Filters
- Users - Gmail - Forwarding
- Users - Gmail - Labels
- Users - Gmail - Messages/Threads
- Users - Gmail - Profile
- Users - Gmail - S/MIME
- Users - Gmail - SendAs/Signature/Vacation
- Users - Gmail - Settings
- Users - Keep - Notes
- Users - Looker Studio
- Users - Meet
- Users - Classroom - Profile
- Users - People - Contacts & Profiles
- Users - Profile Photo
- Users - Shared Drives
- Users - Spreadsheets
- Users - Tasks
- Users - YouTube
GAM Tutorials
- Account Auditing
- Calendar Settings
- Chat Bot commands
- Chrome Browser Management
- Chrome Policy Settings
- Context Aware Access levels
- Data Transfers
- Domain Verification
- Google Drive Management
- Group Settings
- Inbound SSO Settings
- Managing Admins
- Managing Classroom
- Managing Custom User Schemas
- Managing Devices
- Managing Organizations
- Managing Product Licenses
- Managing Users, Groups, Aliases, Domains, Mobile and Chrome Devices, and Resource Calendars
- OAuth Authentication Related Commands
- Print Users, Groups, Aliases, Mobile and Chrome OS devices, OUs, Licenses and Reports
- Printers
- Unmanaged Users and Invitations
- User Email Settings
- User Security Settings