Skip to main content

Google Chat

Google Chat Splash

Required Variables

  1. GOOGLECHAT_STUDIO_FLOW_SID (Guide)
  2. GOOGLECHAT_SERVICE_ACCOUNT_KEY_BASE64

Setup

  1. Ensure you have the following before proceeding
    • A Google Workspace account with access to Google Chat.
    • A Google Cloud Project (Guide)
  2. Login to your Google Cloud Console and Enable Google Chat API
  3. Within your Google Cloud Console > Google Chat API, click on Credentials followed by + Create Credentials
  4. Select Service Account
  5. Follow the on-screen instructions to create the Service Account and click CREATE AND CONTINUE
    • Service Account Name: flex-conversations-adapaters
    • Service Account ID: <<AUTO FILLED>>
    • Service Account Description: Conversations Adapters - Google Chat
  6. Click DONE. You can skip the optional steps.
    • Service Account
  7. After your Service Account has been successfully created, click into it and go to KEYS > ADD KEYS > Create new key. Select JSON for the Key Type and click CREATE.
    • The .json credentials file will be automatically downloaded to your local computer
  8. Open up your terminal / bash client and cd to the folder where your .json credential files reside and issue the following command
    •    cat <<JSON CREDENTIALS FILE NAME>> | base64
  9. Copy the entire output from your terminal / bash client as it will be the value for GOOGLECHAT_SERVICE_ACCOUNT_KEY_BASE64
    • Base64 Credentials

Configure Incoming Webhook

  1. Ensure you have deployed Conversations Adapters into your Twilio Flex account
  2. Ensure you are logged into Google Cloud Console - Chat API
  3. Select Google Chat API > Configuration
  4. Under App Url, insert your deployed incoming webhook
    • The Conversations Adapters incoming webhook URL should be in the format of https://twilio-flex-conversations-adapters-<RANDOMNUMBER>-dev.twil.io/api/googlechat/incoming
    • Google Chat Webhook
  5. To make the Google Chat App visible, add the email addresses of people/group under the Visibility section
    • Google Chat Visibility

Known Limitations

  • Images sent from Flex Agent to End User will be invalidated after 300 seconds (Read more: here). If you require longer validity, do consider extending the codebase to upload media to Google Drive.
  • Google's Service Account Authentication for Google Chat API does not support Media Upload (i.e. Video). Read here for more information