docs / articles / Google Chat API Message Format

Google Chat API Message Format

Sara Jul 09, 2026 2026-07-09 04:40:45

Google Chat API allows developers to integrate real-time messaging functionality into their applications. Understanding the message format is crucial for effective implementation. Let's delve into the intricacies of Google Chat API message format.

Google Chat could soon get a major upgrade with scheduled messages and Gemini (APK teardown)
Google Chat could soon get a major upgrade with scheduled messages and Gemini (APK teardown)

The Google Chat API message format is designed to be flexible and extensible, supporting various message types and features. It's crucial to understand the basic structure to build robust chat functionality.

How to Start a Google Chat Call Directly From Gmail
How to Start a Google Chat Call Directly From Gmail

Message Structure

The core of the Google Chat API message format is the message object, which contains the following properties:

https://sites.google.com/view/country-dating-usa/?first-chat-format-for-client-pdf-lifestyle
https://sites.google.com/view/country-dating-usa/?first-chat-format-for-client-pdf-lifestyle

  • text: The main content of the message, a string.
  • sender: An object containing information about the message sender.
  • timestamp: The time the message was sent, in ISO 8601 format.
  • type: The message type, such as 'text' or 'card'.

Message Types

richardlinda989@gmail.com
richardlinda989@gmail.com

Google Chat API supports several message types, each with its unique format:

  • Text Message: The most basic message type, containing plain text.
  • Card Message: A rich message format supporting structured content, like lists, images, and buttons.
  • Section Message: A message type used to group related messages together.

Message Cards

an iphone screen with the text search chat on it and several different images above them
an iphone screen with the text search chat on it and several different images above them

Cards are a powerful way to create engaging, interactive messages. A card message consists of an array of sections, each containing an array of widgets.

Widgets can be text, images, buttons, or other interactive elements. Here's a simple card message example:

{
  "cards": [
    {
      "sections": [
        {
          "widgets": [
            {
              "textParagraph": {
                "text": "This is a card message with a text paragraph."
              }
            }
          ]
        }
      ]
    }
  ]
}

an email to someone about dating
an email to someone about dating

Message Sender

The sender object in a message provides information about who sent the message. It includes properties like displayName, email, and avatarUrl.

How to Use Google Reply in Android to Simplify and Automate Messaging - Make Tech Easier
How to Use Google Reply in Android to Simplify and Automate Messaging - Make Tech Easier
the google chat button is shown with an update icon and updating options on it
the google chat button is shown with an update icon and updating options on it
Google Allo is now available for desktop… but who cares?
Google Allo is now available for desktop… but who cares?
the text on the phone is very funny
the text on the phone is very funny
play for
play for
Chat buatan
Chat buatan
click here for fake chats
click here for fake chats
Introducing ChatGPT search
Introducing ChatGPT search
add me on Google chat!!
add me on Google chat!!
How To Chat With Your Gmail Contacts From Within The App - BGR
How To Chat With Your Gmail Contacts From Within The App - BGR
two texts are being shared to each other on the same page, one is in conversation with
two texts are being shared to each other on the same page, one is in conversation with
https://t.me/+Va3ilXD5yXI1ZDY0
https://t.me/+Va3ilXD5yXI1ZDY0
Green flags exist
Green flags exist
Flutter Real-Time Chat App — Messaging With Firebase Backend
Flutter Real-Time Chat App — Messaging With Firebase Backend
Google Messages : cette nouveauté bien pratique arrive enfin en France — Frandroid
Google Messages : cette nouveauté bien pratique arrive enfin en France — Frandroid
two screens showing different messages on the same screen, one is in conversation and the other has
two screens showing different messages on the same screen, one is in conversation and the other has
an app that says your account is being closed, and the text below it reads
an app that says your account is being closed, and the text below it reads
the text messages are all written in different languages and shapes, with hearts on them
the text messages are all written in different languages and shapes, with hearts on them
text messages are being displayed on an iphone's screen, with the caption message added
text messages are being displayed on an iphone's screen, with the caption message added
I swear it’s a normal form 😃😃😀
I swear it’s a normal form 😃😃😀

For bot messages, the type property will be 'bot'. For user messages, it will be 'user'.

Sending Messages

To send a message using the Google Chat API, you'll need to make a POST request to the spaces.messages.create method, with the message data in the request body.

Here's a simple example using the fetch API:

fetch('https://chat.googleapis.com/v1/spaces/AAAA.../messages', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json; UTF-8'
  },
  body: JSON.stringify({
    "text": "Hello, world!"
  })
})
.then(response => response.json())
.then(data => console.log(data));

In conclusion, understanding the Google Chat API message format is key to building engaging, interactive chat experiences. Whether you're sending plain text messages or rich card messages, the Google Chat API provides the tools you need to create compelling chat functionality.