Method: spaces.messages.replaceCards

Replaces the cards included in a message.

A Chat app can only replace cards on a human-created message if the message already contains cards, and the cards were created by the app.

If the app replaces the cards with an empty list, the cards are removed. After removing the cards, the app cannot add cards back to the message.

Requires app authentication with the authorization scope: - https://www.googleapis.com/auth/chat.bot

HTTP request

POST https://chat.googleapis.com/v1/{name=spaces/*/messages/*}:replaceCards

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. The resource name of the message.

Format: spaces/{space}/messages/{message}

Request body

The request body contains data with the following structure:

JSON representation
{
  "cardsV2": [
    {
      object (CardWithId)
    }
  ]
}
Fields
cardsV2[]

object (CardWithId)

Optional. An array of cards to be included in the message. These cards will replace the existing cards of the message. If empty, the original cards included in the message will be cleared.

Response body

If successful, the response body is empty.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/chat.bot

For more information, see the Authorization guide.