Gchat
Read Google Chat, and answer from here.
Sign in with the Google Workspace account that owns the conversations. Messages you send go out as you.
- Use a Business or Enterprise Google Workspace account. Personal Gmail accounts cannot call the Chat API.
- In Google Cloud, enable the Google Chat API and set the OAuth audience. Internal covers your organization. External works while the app is in testing, if your account is a test user.
-
Create an OAuth client.
For a web client, add this redirect URI:
http://localhost:3789/oauth/callbackA desktop client can use the same URI without registering it. -
To send replies, open the
Chat API configuration,
set an app name, description, and avatar URL, then leave interactive features off and save.
Google shows that app name beside messages sent from here. Avatar URL:
https://developers.google.com/chat/images/quickstart-app-avatar.png -
If the consent screen asks for scopes, add
chat.spaces.readonly,chat.memberships.readonly, andchat.messages. -
Put the client ID and secret in
.envin this project:
Save the file and refresh this page.GOOGLE_CLIENT_ID=your-id.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=your-secret