Show / Hide Table of Contents

Class SpacesResource.MessagesResource

The "messages" collection of methods.

Inheritance
object
SpacesResource.MessagesResource
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.HangoutsChat.v1
Assembly: Google.Apis.HangoutsChat.v1.dll
Syntax
public class SpacesResource.MessagesResource

Constructors

MessagesResource(IClientService)

Constructs a new resource.

Declaration
public MessagesResource(IClientService service)
Parameters
Type Name Description
IClientService service

Properties

Attachments

Gets the Attachments resource.

Declaration
public virtual SpacesResource.MessagesResource.AttachmentsResource Attachments { get; }
Property Value
Type Description
SpacesResource.MessagesResource.AttachmentsResource

Reactions

Gets the Reactions resource.

Declaration
public virtual SpacesResource.MessagesResource.ReactionsResource Reactions { get; }
Property Value
Type Description
SpacesResource.MessagesResource.ReactionsResource

Methods

Create(Message, string)

Creates a message in a Google Chat space. For an example, see Send a message. Supports the following types of authentication: - App authentication with the authorization scope: - https://www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.messages.create - https://www.googleapis.com/auth/chat.messages - https://www.googleapis.com/auth/chat.import (import mode spaces only) Chat attributes the message sender differently depending on the type of authentication that you use in your request. The following image shows how Chat attributes a message when you use app authentication. Chat displays the Chat app as the message sender. The content of the message can contain text (text), cards (cardsV2), and accessory widgets (accessoryWidgets). Message sent with app
authentication The following image shows how Chat attributes a message when you use user authentication. Chat displays the user as the message sender and attributes the Chat app to the message by displaying its name. The content of message can only contain text (text). Message sent with user
authentication The maximum message size, including the message contents, is 32,000 bytes. For webhook requests, the response doesn't contain the full message. The response only populates the name and thread.name fields in addition to the information that was in the request.

Declaration
public virtual SpacesResource.MessagesResource.CreateRequest Create(Message body, string parent)
Parameters
Type Name Description
Message body

The body of the request.

string parent

Required. The resource name of the space in which to create a message. Format: spaces/{space}

Returns
Type Description
SpacesResource.MessagesResource.CreateRequest

Delete(string)

Deletes a message. For an example, see Delete a message. Supports the following types of authentication: - App authentication with the authorization scope: - https://www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.messages - https://www.googleapis.com/auth/chat.import (import mode spaces only) When using app authentication, requests can only delete messages created by the calling Chat app.

Declaration
public virtual SpacesResource.MessagesResource.DeleteRequest Delete(string name)
Parameters
Type Name Description
string name

Required. Resource name of the message. Format: spaces/{space}/messages/{message} If you've set a custom ID for your message, you can use the value from the clientAssignedMessageId field for {message}. For details, see [Name a message] (https://developers.google.com/workspace/chat/create-messages#name_a_created_message).

Returns
Type Description
SpacesResource.MessagesResource.DeleteRequest

Get(string)

Returns details about a message. For an example, see Get details about a message. Supports the following types of authentication: - App authentication with the authorization scope: - https://www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.messages.readonly - https://www.googleapis.com/auth/chat.messages Note: Might return a message from a blocked member or space.

Declaration
public virtual SpacesResource.MessagesResource.GetRequest Get(string name)
Parameters
Type Name Description
string name

Required. Resource name of the message. Format: spaces/{space}/messages/{message} If you've set a custom ID for your message, you can use the value from the clientAssignedMessageId field for {message}. For details, see [Name a message] (https://developers.google.com/workspace/chat/create-messages#name_a_created_message).

Returns
Type Description
SpacesResource.MessagesResource.GetRequest

List(string)

Lists messages in a space that the caller is a member of, including messages from blocked members and spaces. If you list messages from a space with no messages, the response is an empty object. When using a REST/HTTP interface, the response contains an empty JSON object, {}. For an example, see List messages. Requires user authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.messages.readonly - https://www.googleapis.com/auth/chat.messages - https://www.googleapis.com/auth/chat.import (import mode spaces only)

Declaration
public virtual SpacesResource.MessagesResource.ListRequest List(string parent)
Parameters
Type Name Description
string parent

Required. The resource name of the space to list messages from. Format: spaces/{space}

Returns
Type Description
SpacesResource.MessagesResource.ListRequest

Patch(Message, string)

Updates a message. There's a difference between the patch and update methods. The patch method uses a patch request while the update method uses a put request. We recommend using the patch method. For an example, see Update a message. Supports the following types of authentication: - App authentication with the authorization scope: - https://www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.messages - https://www.googleapis.com/auth/chat.import (import mode spaces only) When using app authentication, requests can only update messages created by the calling Chat app.

Declaration
public virtual SpacesResource.MessagesResource.PatchRequest Patch(Message body, string name)
Parameters
Type Name Description
Message body

The body of the request.

string name

Identifier. Resource name of the message. Format: spaces/{space}/messages/{message} Where {space} is the ID of the space where the message is posted and {message} is a system-assigned ID for the message. For example, spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB. If you set a custom ID when you create a message, you can use this ID to specify the message in a request by replacing {message} with the value from the clientAssignedMessageId field. For example, spaces/AAAAAAAAAAA/messages/client-custom-name. For details, see Name a message.

Returns
Type Description
SpacesResource.MessagesResource.PatchRequest

Update(Message, string)

Updates a message. There's a difference between the patch and update methods. The patch method uses a patch request while the update method uses a put request. We recommend using the patch method. For an example, see Update a message. Supports the following types of authentication: - App authentication with the authorization scope: - https://www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.messages - https://www.googleapis.com/auth/chat.import (import mode spaces only) When using app authentication, requests can only update messages created by the calling Chat app.

Declaration
public virtual SpacesResource.MessagesResource.UpdateRequest Update(Message body, string name)
Parameters
Type Name Description
Message body

The body of the request.

string name

Identifier. Resource name of the message. Format: spaces/{space}/messages/{message} Where {space} is the ID of the space where the message is posted and {message} is a system-assigned ID for the message. For example, spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB. If you set a custom ID when you create a message, you can use this ID to specify the message in a request by replacing {message} with the value from the clientAssignedMessageId field. For example, spaces/AAAAAAAAAAA/messages/client-custom-name. For details, see Name a message.

Returns
Type Description
SpacesResource.MessagesResource.UpdateRequest
In this article
Back to top Generated by DocFX