Interact with the Google Chat API via AppsScripts.
- Create a service account that has access to Chat API
- Add
ChatService
to your project with Library ID1XDYAGcUoblJ073Kjveni2WOZHpKLYE8qlYMkeHViavLXvsKnBIl1DR2A
- Send the
privateKey
andissuerEmail
to theChatService.init
method - The returning object has
Spaces
,Members
, andMessages
namespaces, which themselves have methods that match the reference documentation.
const Chat = ChatService.init('<privateKey>', '<issuerEmail>');
const rooms = Chat.Spaces.list();
Logger.log(rooms);
- Use the provided documentation for learn how to use all of these methods.
AppsScript doesn't have a native advanced service to interact with the Chat API. And I need one, so I made one!
- A Google Form that opens a new thread on a Google Chat room on submission
- Poll your domain for Chat room activity
Currently used in production, but feedback welcome. Thanks for any contributions. Use the issue github tracker for issues.