Show / Hide Table of Contents

Class SpacesResource.MessagesResource.CreateRequest

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.

Inheritance
object
ClientServiceRequest
ClientServiceRequest<Message>
HangoutsChatBaseServiceRequest<Message>
SpacesResource.MessagesResource.CreateRequest
Implements
IClientServiceRequest<Message>
IClientServiceRequest
Inherited Members
HangoutsChatBaseServiceRequest<Message>.Xgafv
HangoutsChatBaseServiceRequest<Message>.AccessToken
HangoutsChatBaseServiceRequest<Message>.Alt
HangoutsChatBaseServiceRequest<Message>.Callback
HangoutsChatBaseServiceRequest<Message>.Fields
HangoutsChatBaseServiceRequest<Message>.Key
HangoutsChatBaseServiceRequest<Message>.OauthToken
HangoutsChatBaseServiceRequest<Message>.PrettyPrint
HangoutsChatBaseServiceRequest<Message>.QuotaUser
HangoutsChatBaseServiceRequest<Message>.UploadType
HangoutsChatBaseServiceRequest<Message>.UploadProtocol
ClientServiceRequest<Message>.Execute()
ClientServiceRequest<Message>.ExecuteAsStream()
ClientServiceRequest<Message>.ExecuteAsync()
ClientServiceRequest<Message>.ExecuteAsync(CancellationToken)
ClientServiceRequest<Message>.ExecuteAsStreamAsync()
ClientServiceRequest<Message>.ExecuteAsStreamAsync(CancellationToken)
ClientServiceRequest<Message>.CreateRequest(bool?)
ClientServiceRequest<Message>.GenerateRequestUri()
ClientServiceRequest<Message>.GetDefaultETagAction(string)
ClientServiceRequest<Message>.ETagAction
ClientServiceRequest<Message>.ModifyRequest
ClientServiceRequest<Message>.ValidateParameters
ClientServiceRequest<Message>.ApiVersion
ClientServiceRequest<Message>.RequestParameters
ClientServiceRequest<Message>.Service
ClientServiceRequest._unsuccessfulResponseHandlers
ClientServiceRequest._exceptionHandlers
ClientServiceRequest._executeInterceptors
ClientServiceRequest.AddUnsuccessfulResponseHandler(IHttpUnsuccessfulResponseHandler)
ClientServiceRequest.AddExceptionHandler(IHttpExceptionHandler)
ClientServiceRequest.AddExecuteInterceptor(IHttpExecuteInterceptor)
ClientServiceRequest.Credential
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.CreateRequest : HangoutsChatBaseServiceRequest<Message>, IClientServiceRequest<Message>, IClientServiceRequest

Constructors

CreateRequest(IClientService, Message, string)

Constructs a new Create request.

Declaration
public CreateRequest(IClientService service, Message body, string parent)
Parameters
Type Name Description
IClientService service
Message body
string parent

Properties

HttpMethod

Gets the HTTP method.

Declaration
public override string HttpMethod { get; }
Property Value
Type Description
string
Overrides
ClientServiceRequest<Message>.HttpMethod

MessageId

Optional. A custom ID for a message. Lets Chat apps get, update, or delete a message without needing to store the system-assigned ID in the message's resource name (represented in the message name field). The value for this field must meet the following requirements: * Begins with client-. For example, client-custom-name is a valid custom ID, but custom-name is not. * Contains up to 63 characters and only lowercase letters, numbers, and hyphens. * Is unique within a space. A Chat app can't use the same custom ID for different messages. For details, see Name a message.

Declaration
[RequestParameter("messageId", RequestParameterType.Query)]
public virtual string MessageId { get; set; }
Property Value
Type Description
string

MessageReplyOption

Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces. When responding to user interactions, this field is ignored. For interactions within a thread, the reply is created in the same thread. Otherwise, the reply is created as a new thread.

Declaration
[RequestParameter("messageReplyOption", RequestParameterType.Query)]
public virtual SpacesResource.MessagesResource.CreateRequest.MessageReplyOptionEnum? MessageReplyOption { get; set; }
Property Value
Type Description
SpacesResource.MessagesResource.CreateRequest.MessageReplyOptionEnum?

MethodName

Gets the method name.

Declaration
public override string MethodName { get; }
Property Value
Type Description
string
Overrides
ClientServiceRequest<Message>.MethodName

Parent

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

Declaration
[RequestParameter("parent", RequestParameterType.Path)]
public virtual string Parent { get; }
Property Value
Type Description
string

RequestId

Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.

Declaration
[RequestParameter("requestId", RequestParameterType.Query)]
public virtual string RequestId { get; set; }
Property Value
Type Description
string

RestPath

Gets the REST path.

Declaration
public override string RestPath { get; }
Property Value
Type Description
string
Overrides
ClientServiceRequest<Message>.RestPath

ThreadKey

Optional. Deprecated: Use thread.thread_key instead. ID for the thread. Supports up to 4000 characters. To start or add to a thread, create a message and specify a threadKey or the thread.name. For example usage, see Start or reply to a message thread.

Declaration
[RequestParameter("threadKey", RequestParameterType.Query)]
public virtual string ThreadKey { get; set; }
Property Value
Type Description
string

Methods

GetBody()

Returns the body of the request.

Declaration
protected override object GetBody()
Returns
Type Description
object
Overrides
ClientServiceRequest<Message>.GetBody()

InitParameters()

Initializes Create parameter list.

Declaration
protected override void InitParameters()
Overrides
HangoutsChatBaseServiceRequest<Message>.InitParameters()

Implements

IClientServiceRequest<TResponse>
IClientServiceRequest
In this article
Back to top Generated by DocFX