Langue

Conversations.CreateConversationWithHttpMessagesAsync Méthode

Définition

Surcharges

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

Paramètres

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

Retours

Task<Microsoft.Rest.HttpOperationResponse<ConversationResourceResponse>>

Implémente

S’applique à

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

Paramètres

parameters
ConversationParameters

Paramètres à partir duquel créer la conversation.

customHeaders
Dictionary<String,List<String>>

Des en-têtes qui seront ajoutés à la requête.

cancellationToken
CancellationToken

Jeton d’annulation.

Retours

Task<Microsoft.Rest.HttpOperationResponse<ConversationResourceResponse>>

Un objet réponse contenant le corps de réponse et les en-têtes de réponse.

Implémente

Exceptions

Déclenché lorsque l’opération a renvoyé un code de statut invalide.

Microsoft.Rest.SerializationException

Rejeté lorsqu’il n’est pas possible de désérialiser la réponse.

Microsoft.Rest.ValidationException

Jetée lorsqu’une valeur d’entrée ne correspond pas au type, à la plage ou au motif attendu.

Lancé lorsqu’un paramètre requis est nul.

Remarques

Créez une conversation.

POST à cette méthode avec un * Bot étant le bot créant la conversation * IsGroup défini sur true si ce n’est pas un message direct (par défaut est faux) * Tableau contenant les membres à inclure dans la conversation

La valeur de retour est ResourceResponse qui contient un ID de conversation qui convient pour une utilisation dans la charge utile du message et les URI de l’API REST.

La plupart des canaux prennent uniquement en charge la sémantique des bots qui lancent une conversation de message direct. Un exemple de comment faire cela serait :

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

.

S’applique à