List reactions for a message

  • This guide explains how to use the list() method to retrieve reactions (e.g., πŸ‘, 🚲, 🌞) for messages in Google Chat using the Google Chat API.

  • Before you begin, ensure you have a Google Workspace account, set up a Google Cloud project, enable the Google Chat API, and install the Node.js Cloud Client Library.

  • To list reactions, call the ListReactions() method, providing the message's resource name and specifying the necessary authorization scope.

  • You'll need the space ID and message ID to construct the resource name for the ListReactions() method call.

  • The Chat API returns a paginated list of reactions for the specified message.

This guide explains how to use the list() method on the Reaction resource of the Google Chat API to list reactions for a messageβ€”like πŸ‘, 🚲, and 🌞.

The Reaction resource represents an emoji that people can use to react to a message, such as πŸ‘, 🚲, and 🌞.

Prerequisites

Node.js

To list the reactions for a message, pass the following in your request:

  • Specify the chat.messages.reactions.readonly, chat.messages.reactions, chat.messages.readonly, or chat.messages authorization scope.
  • Call the ListReactions() method, passing the parent as the resource name of the message.

The following example lists reactions for a specified message:

Node.js

To run this sample, replace the following:

  • SPACE_NAME: the ID from the space's name. You can obtain the ID by calling the ListSpaces() method or from the space's URL.
  • MESSAGE_NAME: the ID from the message's name. You can obtain the ID from the response body returned after creating a message asynchronously with the Chat API, or with the custom name assigned to the message at creation.

The Chat API returns a paginated list of reactions.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.