Lenguaje

Conversations.CreateConversationWithHttpMessagesAsync Método

Definición

Sobrecargas

CreateConversationWithHttpMessagesAsync(ConversationParameters, Dictionary<String,List<String>>, CancellationToken)

public System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Connector.ConversationResourceResponse>> CreateConversationWithHttpMessagesAsync(Microsoft.Bot.Connector.ConversationParameters parameters, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateConversationWithHttpMessagesAsync : Microsoft.Bot.Connector.ConversationParameters * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Connector.ConversationResourceResponse>>
override this.CreateConversationWithHttpMessagesAsync : Microsoft.Bot.Connector.ConversationParameters * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Connector.ConversationResourceResponse>>
Public Function CreateConversationWithHttpMessagesAsync (parameters As ConversationParameters, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpOperationResponse(Of ConversationResourceResponse))

Parámetros

customHeaders
Dictionary<String,List<String>>
cancellationToken
CancellationToken

Devoluciones

Task<Microsoft.Rest.HttpOperationResponse<ConversationResourceResponse>>

Implementaciones

Se aplica a

CreateConversationWithHttpMessagesAsync(ConversationParameters, Dictionary<String,List<String>>, CancellationToken)

CreateConversation.

public System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Schema.ConversationResourceResponse>> CreateConversationWithHttpMessagesAsync(Microsoft.Bot.Schema.ConversationParameters parameters, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateConversationWithHttpMessagesAsync : Microsoft.Bot.Schema.ConversationParameters * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Schema.ConversationResourceResponse>>
override this.CreateConversationWithHttpMessagesAsync : Microsoft.Bot.Schema.ConversationParameters * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Schema.ConversationResourceResponse>>
Public Function CreateConversationWithHttpMessagesAsync (parameters As ConversationParameters, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpOperationResponse(Of ConversationResourceResponse))

Parámetros

parameters
ConversationParameters

Parámetros a partir de los que se va a crear la conversación.

customHeaders
Dictionary<String,List<String>>

Cabeceras que se añadirán a la solicitud.

cancellationToken
CancellationToken

Token de cancelación.

Devoluciones

Task<Microsoft.Rest.HttpOperationResponse<ConversationResourceResponse>>

Un objeto de respuesta que contiene el cuerpo de respuesta y los encabezados de respuesta.

Implementaciones

Excepciones

Se desactivó cuando la operación devolvió un código de estado inválido.

Microsoft.Rest.SerializationException

Lo lanzamos cuando no se puede desserializar la respuesta.

Microsoft.Rest.ValidationException

Se lanza cuando un valor de entrada no coincide con el tipo de dato esperado, rango o patrón.

Se lanza cuando un parámetro requerido es nulo.

Comentarios

Cree una nueva conversación.

POST a este método con un * Bot siendo el bot que crea la conversación * IsGroup puesto en verdadero si esto no es un mensaje directo (por defecto es falso) * Array que contiene a los miembros a incluir en la conversación

El valor devuelto es un ResourceResponse que contiene un identificador de conversación que es adecuado para su uso en la carga del mensaje y los uri de la API REST.

La mayoría de los canales solo admiten la semántica de los bots que inician una conversación de mensaje directo. Un ejemplo de cómo hacerlo sería:

var resource = await connector.conversations.CreateConversation(new
ConversationParameters(){ Bot = bot, members = new ChannelAccount[] { new
ChannelAccount("user1") } );
await connect.Conversations.SendToConversationAsync(resource.Id, new
Activity() ... ) ;

.

Se aplica a