Tag Archives: Hangouts Chat

Developing bots for Hangouts Chat

Posted by Wesley Chun (@wescpy), Developer Advocate, G Suite

We recently introduced Hangouts Chat to general availability. This next-generation messaging platform gives G Suite users a new place to communicate and to collaborate in teams. It features archive & search, tighter G Suite integration, and the ability to create separate, threaded chat rooms. The key new feature for developers is a bot framework and API. Whether it's to automate common tasks, query for information, or perform other heavy-lifting, bots can really transform the way we work.

In addition to plain text replies, Hangouts Chat can also display bot responses with richer user interfaces (UIs) called cards which can render header information, structured data, images, links, buttons, etc. Furthermore, users can interact with these components, potentially updating the displayed information. In this latest episode of the G Suite Dev Show, developers learn how to create a bot that features an updating interactive card.

As you can see in the video, the most important thing when bots receive a message is to determine the event type and take the appropriate action. For example, a bot will perform any desired "paperwork" when it is added to or removed from a room or direct message (DM), generically referred to as a "space" in the vernacular.

Receiving an ordinary message sent by users is the most likely scenario; most bots do "their thing" here in serving the request. The last event type occurs when a user clicks on an interactive card. Similar to receiving a standard message, a bot performs its requisite work, including possibly updating the card itself. Below is some pseudocode summarizing these four event types and represents what a bot would likely do depending on the event type:

function processEvent(req, rsp) {
var event = req.body; // event type received
var message; // JSON response message

if (event.type == 'REMOVED_FROM_SPACE') {
// no response as bot removed from room
return;

} else if (event.type == 'ADDED_TO_SPACE') {
// bot added to room; send welcome message
message = {text: 'Thanks for adding me!'};

} else if (event.type == 'MESSAGE') {
// message received during normal operation
message = responseForMsg(event.message.text);

} else if (event.type == 'CARD_CLICKED') {
// user-click on card UI
var action = event.action;
message = responseForClick(
action.actionMethodName, action.parameters);
}

rsp.send(message);
};

The bot pseudocode as well as the bot featured in the video respond synchronously. Bots performing more time-consuming operations or those issuing out-of-band notifications, can send messages to spaces in an asynchronous way. This includes messages such as job-completed notifications, alerts if a server goes down, and pings to the Sales team when a new lead is added to the CRM (Customer Relationship Management) system.

Hangouts Chat supports more than JavaScript or Python and Google Apps Script or Google App Engine. While using JavaScript running on Apps Script is one of the quickest and simplest ways to get a bot online within your organization, it can easily be ported to Node.js for a wider variety of hosting options. Similarly, App Engine allows for more scalability and supports additional languages (Java, PHP, Go, and more) beyond Python. The bot can also be ported to Flask for more hosting options. One key takeaway is the flexibility of the platform: developers can use any language, any stack, or any cloud to create and host their bot implementations. Bots only need to be able to accept HTTP POST requests coming from the Hangouts Chat service to function.

At Google I/O 2018 last week, the Hangouts Chat team leads and I delivered a longer, higher-level overview of the bot framework. This comprehensive tour of the framework includes numerous live demos of sample bots as well as in a variety of languages and platforms. Check out our ~40-minute session below.

To help you get started, check out the bot framework launch post. Also take a look at this post for a deeper dive into the Python App Engine version of the vote bot featured in the video. To learn more about developing bots for Hangouts Chat, review the concepts guides as well as the "how to" for creating bots. You can build bots for your organization, your customers, or for the world. We look forward to all the exciting bots you're going to build!

Google Vault support for Hangouts Chat

We just announced some new G Suite products and features to help your organization collaborate more effectively and efficiently. As part of that announcement, we introduced Google Vault support for Hangouts Chat. Below are some admin-specific details to help you get started.

The newly launched Hangouts Chat is an intelligent and secure tool that makes team collaboration easy. An enterprise-ready solution, Hangouts Chat gives G Suite admins the governance controls they need to manage and secure their organization’s data, including full support in Google Vault—a tool that can help with their eDiscovery and compliance needs.

Set retention policies for Hangouts Chat messages
As a G Suite admin, you can now set retention policies that apply to all Hangouts Chat messages, including those sent directly and those sent in rooms.

You can set a default rule that applies to all users in your domain. This can be an indefinite retention policy (such that messages are never expunged), or one that expunges messages at the end of a specific time period. The default rule applies to all direct messages and rooms in your domain.

You can also set custom retention rules for specific organizational units (OUs), which apply to direct messages only, and/or for all rooms, which apply to room conversations only. This allows you to manage the lifecycle of direct and room messages separately. Custom rules override the default rule and, if multiple custom rules apply to a message, the rule with the longest retention coverage period takes precedence.


Place legal holds on Hangouts Chat messages
In addition to setting retention policies, you can now place legal holds on your employees' Hangouts Chat conversations, whether they take place via direct message or in rooms.

Doing so will preserve room conversations in which a held user is a participant (i.e. they’ve sent a message) and direct messages in which a held user is a member (i.e. they’ve sent or received a message), regardless of whether that user deletes those messages. If a user on hold deletes a message, it will appear deleted to them—but it will be available in Vault until the hold is removed. Remember that holds always take precedence over retention rules.


Search, preview and export chat content 
Finally, you can now search, preview, and export your employees’ Hangouts Chat messages. This enables you to apply the same eDiscovery programs you use for other G Suite services (like Gmail and Drive) to content stored in Hangouts Chat direct messages and rooms.


To learn more about how Vault's support for Hangouts Chat can help your organization meet its legal obligations and archiving needs, check out the Vault Help Center.

Launch Details
Release track:
Launching to both Rapid Release and Scheduled Release

Editions:
Available to G Suite Business, Enterprise, and Education editions only

Rollout pace:
Gradual rollout (up to 15 days for feature visibility)

Impact:
Admins only

Action:
Admin action suggested/FYI

More Information
Help Center: Google Vault
Help Center: Supported data types
The Keyword: New ways to help teams work faster and smarter with G Suite
The Keyword: Move projects forward from one place—Hangouts Chat now available
G Suite Updates: Hangouts Chat now generally available



Launch release calendar
Launch detail categories
Get these product update alerts by email
Subscribe to the RSS feed of these updates

Hangouts Chat now generally available

We just announced some new G Suite products and features to help your organization collaborate more effectively and efficiently. As part of that announcement, we introduced Hangouts Chat as a core service. Below are some admin-specific details about Hangouts Chat to help you get started.

The Hangouts Chat service will launch default on, unless you’ve chosen to manually opt in to new services. To start using Hangouts Chat on the web, go to https://chat.google.com. To download the app on your desktop or mobile device, go to https://get.google.com/chat.

Please note:
  • If you currently have forced chat history off, you will need to actively enable Hangouts Chat in your Admin console regardless of your setting for opting in to new services. This is because “room” conversations in Chat always retain Chat history, regardless of your settings, so it's important that you understand this before enabling the service.
  • If both classic Hangouts and the new Hangouts Chat are enabled for an organizational unit (OU), the classic Hangouts history on or off settings are used in chats in which participants use a mix of classic and new Chat. If the history settings are different for chat participants of different OUs, the chat conversation can’t be created. Please review your chat history settings for both products (more info).
  • If your domain participated in the Hangouts Chat Early Adopter Program, your settings will be retained. These settings will be accessible at Apps > G Suite > Hangouts Chat in the Admin console.
Hangouts Chat is compatible with the classic version of Hangouts, and you’ll still be able to use classic Hangouts—making sure you don’t miss a message from anyone in your organization. All one-to-one direct messages will forward both ways between Hangouts Chat and classic Hangouts by default.

Additionally, if you require Vault support for use of Hangouts Chat, please see our post for details on that launch.

If you have any further questions, check out the get started guide or visit the Help Center.

Launch Details
Release track:
Launching to both Rapid Release and Scheduled Release

Editions:
Available to all G Suite editions except Government

Rollout pace:
Gradual rollout (up to 15 days for feature visibility)

Impact:
All end users

Action:
Change management suggested/FYI

More Information
Help Center: Turn Hangouts Chat on or off
Help Center: Sign in to Hangouts Chat
Help Center: About bots
The Keyword: New ways to help teams work faster and smarter with G Suite
The Keyword: Move projects forward from one place—Hangouts Chat now available
The Keyword: Meet the new Hangouts
G Suite Updates: Google Vault support for Hangouts Chat


Launch release calendar
Launch detail categories
Get these product update alerts by email
Subscribe to the RSS feed of these updates

Hangouts Meet now publicly available and Hangouts Chat Early Adopter Program now accepting applications

Earlier today, we announced the public launch of Hangouts Meet and the Early Adopter Program for Hangouts Chat, the new enterprise-focused video meetings and online messaging experiences coming to Google Hangouts. Learn more about the new Hangouts in our blog post here: Meet the new Hangouts.

Getting started with Meet

If you are a G Suite administrator, the ability to enable specific organizational units for Meet or even your entire domain is gradually rolling out starting today.
Because Meet is launching default off for existing Hangouts users, you have the flexibility and control to plan and coordinate the rollout of Meet with your team and users.

Applying for early access to Chat

Launch Details

Release track:
Launching to both Rapid release and Scheduled release

Editions:
Meet is now available to all G Suite editions; however, the ability to create meetings with a dial-in phone number is only available to Enterprise edition users

Rollout pace:
Gradual rollout (potentially longer than 3 days for feature visibility)

Impact:
Admins only
For existing domains, Admins can choose when to enable Google Meet for their users.
For newly created domains, Google Meet will be enabled by default.

Action:
Admin action suggested/FYI

More Information
Help Center: Enable the new Hangouts video meetings experience (Administrators)
Help Center: Create or join a new Hangouts video meetings experience (End-users)
Hangouts Meet Learning Center (End-users)
The Keyword