Condividi tramite


Conversations.CreateConversationWithHttpMessagesAsync Metodo

Definizione

Overload

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

CreateConversation.

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))

Parametri

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

Restituisce

Task<Microsoft.Rest.HttpOperationResponse<ConversationResourceResponse>>

Implementazioni

Si applica 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))

Parametri

parameters
ConversationParameters

Parametri da cui creare la conversazione.

customHeaders
Dictionary<String,List<String>>

Intestazioni che verranno aggiunte alla richiesta.

cancellationToken
CancellationToken

Token di annullamento.

Restituisce

Task<Microsoft.Rest.HttpOperationResponse<ConversationResourceResponse>>

Oggetto risposta contenente il corpo della risposta e le intestazioni di risposta.

Implementazioni

Eccezioni

Generata quando l'operazione ha restituito un codice di stato non valido.

Microsoft.Rest.SerializationException

Generata quando non è possibile deserializzare la risposta.

Microsoft.Rest.ValidationException

Generata quando un valore di input non corrisponde al tipo di dati, all'intervallo o al criterio previsti.

Generata quando un parametro obbligatorio è Null.

Commenti

Creare una nuova conversazione.

POST per questo metodo con un * Bot che sta creando la conversazione * IsGroup impostato su true se questo non è un messaggio diretto (il valore predefinito è false) * Matrice contenente i membri da includere nella conversazione

Il valore restituito è resourceResponse che contiene un ID conversazione adatto per l'uso nel payload del messaggio e negli URI dell'API REST.

La maggior parte dei canali supporta solo la semantica dei bot che avviano una conversazione diretta dei messaggi. Un esempio di come eseguire questa operazione è:

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

.

Si applica a