Language

ConversationClient.CreateConversationAsync Method

Definition

Creates a new conversation.

public virtual System.Threading.Tasks.Task<Microsoft.Teams.Core.CreateConversationResponse> CreateConversationAsync(Microsoft.Teams.Core.ConversationParameters parameters, Uri serviceUrl, Microsoft.Teams.Core.Http.BotRequestContext? requestContext = default, System.Collections.Generic.Dictionary<string,string>? customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateConversationAsync : Microsoft.Teams.Core.ConversationParameters * Uri * Microsoft.Teams.Core.Http.BotRequestContext * System.Collections.Generic.Dictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Teams.Core.CreateConversationResponse>
override this.CreateConversationAsync : Microsoft.Teams.Core.ConversationParameters * Uri * Microsoft.Teams.Core.Http.BotRequestContext * System.Collections.Generic.Dictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Teams.Core.CreateConversationResponse>
Public Overridable Function CreateConversationAsync (parameters As ConversationParameters, serviceUrl As Uri, Optional requestContext As BotRequestContext = Nothing, Optional customHeaders As Dictionary(Of String, String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of CreateConversationResponse)

Parameters

parameters
ConversationParameters

The parameters for creating the conversation. Cannot be null.

serviceUrl
Uri

The service URL for the bot. Cannot be null.

requestContext
BotRequestContext

Optional per-request properties (see BotRequestContext) to stamp onto the request's options.

customHeaders
Dictionary<String,String>

Optional custom headers to include in the request.

cancellationToken
CancellationToken

A cancellation token that can be used to cancel the operation.

Returns

A task that represents the asynchronous operation. The task result contains the conversation resource response with the conversation ID.

Exceptions

Thrown if the conversation could not be created successfully.

Applies to