Chat
Create Chatmember
By default the role will be member. Add role manager to add them as a manager.
gam user <Space Manager Email> create chatmember <Space ID> user <New Member Email>
Create ChatSpace
Blank
The <Type> can be space|groupchat|directmessage, edit as required.
gam user <User Email Address> create chatspace type <Type> displayname '<Chat Space Name>'
Space With Members
This creates a Chat Space and adds the memebers.
gam user <User Email Address> create chatspace type space displayname '<Chat Space Name>' members <Member 1 Email>,<Member 2 Email>,<ETC>
GroupChat with Members and Message
Chat Groups do not have a name. If a Message (text) is not specified, then the Chat Group will not be created.
gam user <User Email Address> create chatspace type groupchat members <Member 1 Email>,<Member 2 Email>,<ETC> text '<Message to send to the Chat Group>'
Delete ChatSpace
Single
gam user <Chat Space Manager Email> delete chatspace <Chat Space ID>
CSV
Note, the ~name is from the results of a print chatspaces command and follows the format of spaces/ABCdefHIJ
gam csv gsheet <Sjeet Owner Email> <Sheet ID> <Tabe Name> gam user ~User delete chatspace ~name
Print Chatmembers
User
gam user <User Email Address> print chatmembers <Chat Space ID> todrive
Create a Google Sheet of the Chat Spaces for a <User Email Address>. This is is then used in the command below to list all the members of the all the Chat Spaces. And from this, determine which <Space ID> are used between specific users.
gam redirect csv - multiprocess append todrive csv gsheet <Sheet Owner Email> <Sheet ID> <Sheet (tab) Name> gam user <User Email Address> print chatmembers ~name
OR
gam user <User Email Address> print chatspaces | gam redirect stdout - multiprocess redirect csv ./ChatSpaces.csv multiprocess csv - gam user <User Email Address> print chatmembers ~name todrive
Print ChatMessages
User & ChatSpace
gam user <User Email Address> print chatmessages <Chat Space name> todrive
User, ChatSpace & createTime
NB the time format needs the hh:mm:ss and offset. Please add these to the command as per your location.
gam user <User Email Address> print chatmessages "<Chat Space name>" filter 'createTime > "yyyy-mm-ddT00:00:00-00:00"' todrive
Print Chatspaces
User
gam user <User Email Address> print chatspaces todrive
User & spaceType
There are 3 spaceTypes, SPACE,GROUP_CHAT and DIRECT_MESSAGE. The command below will filter out DIRECT_MESSAGE spaceTypes leaving SPACE & GROUP_CHAT.
gam config csv_output_row_filter "'spaceType:regex:SPACE|GROUP_CHAT'" user <User Email Address> print chatspaces todrive
OU
gam ou_and_children </Path/To/Top/OU> print chatspaces todrive
Print Messages (Gmail)
With the lack of a Google API for Chat, you can use the matchlabel chats option to search Chats in as users email. Use tomorrows date to capture todays Chats.
Date Range
gam user <User Email Address> print messages matchlabel chats query "after:yyyy-mm-dd before:yyyy-mm-dd" showbody todrive
To
gam user <User Email Address> print messages matchlabel chats query "to:<Recipient Email Address>" showbody todrive
From
gam user <User Email Address> print messages matchlabel chats query "from:<Recipient Email Address>" showbody todrive