Google Chat API . spaces . messages . reactions

Instance Methods

close()

Close httplib2 connections.

create(parent, body=None, x__xgafv=None)

Creates a reaction and adds it to a message. Only unicode emojis are supported. For an example, see [Add a reaction to a message](https://developers.google.com/workspace/chat/create-reactions). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).

delete(name, x__xgafv=None)

Deletes a reaction to a message. Only unicode emojis are supported. For an example, see [Delete a reaction](https://developers.google.com/workspace/chat/delete-reactions). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).

list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)

Lists reactions to a message. For an example, see [List reactions for a message](https://developers.google.com/workspace/chat/list-reactions). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).

list_next()

Retrieves the next page of results.

Method Details

close()
Close httplib2 connections.
create(parent, body=None, x__xgafv=None)
Creates a reaction and adds it to a message. Only unicode emojis are supported. For an example, see [Add a reaction to a message](https://developers.google.com/workspace/chat/create-reactions). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).

Args:
  parent: string, Required. The message where the reaction is created. Format: `spaces/{space}/messages/{message}` (required)
  body: object, The request body.
    The object takes the form of:

{ # A reaction to a message.
  "emoji": { # An emoji that is used as a reaction to a message. # The emoji used in the reaction.
    "customEmoji": { # Represents a custom emoji. # Output only. A custom emoji.
      "uid": "A String", # Output only. Unique key for the custom emoji resource.
    },
    "unicode": "A String", # A basic emoji represented by a unicode string.
  },
  "name": "A String", # The resource name of the reaction. Format: `spaces/{space}/messages/{message}/reactions/{reaction}`
  "user": { # A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource only populates the user's `name` and `type`. # Output only. The user who created the reaction.
    "displayName": "A String", # Output only. The user's display name.
    "domainId": "A String", # Unique identifier of the user's Google Workspace domain.
    "isAnonymous": True or False, # Output only. When `true`, the user is deleted or their profile is not visible.
    "name": "A String", # Resource name for a Google Chat user. Format: `users/{user}`. `users/app` can be used as an alias for the calling app bot user. For human users, `{user}` is the same user identifier as: - the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.
    "type": "A String", # User type.
  },
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A reaction to a message.
  "emoji": { # An emoji that is used as a reaction to a message. # The emoji used in the reaction.
    "customEmoji": { # Represents a custom emoji. # Output only. A custom emoji.
      "uid": "A String", # Output only. Unique key for the custom emoji resource.
    },
    "unicode": "A String", # A basic emoji represented by a unicode string.
  },
  "name": "A String", # The resource name of the reaction. Format: `spaces/{space}/messages/{message}/reactions/{reaction}`
  "user": { # A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource only populates the user's `name` and `type`. # Output only. The user who created the reaction.
    "displayName": "A String", # Output only. The user's display name.
    "domainId": "A String", # Unique identifier of the user's Google Workspace domain.
    "isAnonymous": True or False, # Output only. When `true`, the user is deleted or their profile is not visible.
    "name": "A String", # Resource name for a Google Chat user. Format: `users/{user}`. `users/app` can be used as an alias for the calling app bot user. For human users, `{user}` is the same user identifier as: - the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.
    "type": "A String", # User type.
  },
}
delete(name, x__xgafv=None)
Deletes a reaction to a message. Only unicode emojis are supported. For an example, see [Delete a reaction](https://developers.google.com/workspace/chat/delete-reactions). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).

Args:
  name: string, Required. Name of the reaction to delete. Format: `spaces/{space}/messages/{message}/reactions/{reaction}` (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
}
list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)
Lists reactions to a message. For an example, see [List reactions for a message](https://developers.google.com/workspace/chat/list-reactions). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).

Args:
  parent: string, Required. The message users reacted to. Format: `spaces/{space}/messages/{message}` (required)
  filter: string, Optional. A query filter. You can filter reactions by [emoji](https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji) (either `emoji.unicode` or `emoji.custom_emoji.uid`) and [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) (`user.name`). To filter reactions for multiple emojis or users, join similar fields with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = "👍"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`. To filter reactions by emoji and user, use the `AND` operator, such as `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. If your query uses both `AND` and `OR`, group them with parentheses. For example, the following queries are valid: ``` user.name = "users/{user}" emoji.unicode = "🙂" emoji.custom_emoji.uid = "{uid}" emoji.unicode = "🙂" OR emoji.unicode = "👍" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" emoji.unicode = "🙂" AND user.name = "users/{user}" (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") AND user.name = "users/{user}" ``` The following queries are invalid: ``` emoji.unicode = "🙂" AND emoji.unicode = "👍" emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" emoji.unicode = "🙂" OR user.name = "users/{user}" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR user.name = "users/{user}" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" AND user.name = "users/{user}" ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error.
  pageSize: integer, Optional. The maximum number of reactions returned. The service can return fewer reactions than this value. If unspecified, the default value is 25. The maximum value is 200; values above 200 are changed to 200.
  pageToken: string, Optional. (If resuming from a previous query.) A page token received from a previous list reactions call. Provide this to retrieve the subsequent page. When paginating, the filter value should match the call that provided the page token. Passing a different value might lead to unexpected results.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response to a list reactions request.
  "nextPageToken": "A String", # Continuation token to retrieve the next page of results. It's empty for the last page of results.
  "reactions": [ # List of reactions in the requested (or first) page.
    { # A reaction to a message.
      "emoji": { # An emoji that is used as a reaction to a message. # The emoji used in the reaction.
        "customEmoji": { # Represents a custom emoji. # Output only. A custom emoji.
          "uid": "A String", # Output only. Unique key for the custom emoji resource.
        },
        "unicode": "A String", # A basic emoji represented by a unicode string.
      },
      "name": "A String", # The resource name of the reaction. Format: `spaces/{space}/messages/{message}/reactions/{reaction}`
      "user": { # A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource only populates the user's `name` and `type`. # Output only. The user who created the reaction.
        "displayName": "A String", # Output only. The user's display name.
        "domainId": "A String", # Unique identifier of the user's Google Workspace domain.
        "isAnonymous": True or False, # Output only. When `true`, the user is deleted or their profile is not visible.
        "name": "A String", # Resource name for a Google Chat user. Format: `users/{user}`. `users/app` can be used as an alias for the calling app bot user. For human users, `{user}` is the same user identifier as: - the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.
        "type": "A String", # User type.
      },
    },
  ],
}
list_next()
Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call 'execute()' on to request the next
          page. Returns None if there are no more items in the collection.