IConversations.CreateConversationWithHttpMessagesAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
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>>
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))
Parameters
- parameters
- ConversationParameters
- customHeaders
- Dictionary<String,List<String>>
- cancellationToken
- CancellationToken
Returns
Applies to
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>>
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))
Parameters
- parameters
- ConversationParameters
Parameters to create the conversation from.
- customHeaders
- Dictionary<String,List<String>>
The headers that will be added to request.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
A task that represents the Microsoft.Rest.HttpOperationResponse.
Exceptions
Thrown when the operation returned an invalid status code.
Thrown when unable to deserialize the response.
Thrown when a required parameter is null.
Remarks
Create a new Conversation.
POST to this method with a * Bot being the bot creating the conversation * IsGroup set to true if this is not a direct message (default is false) * Array containing the members to include in the conversation
The return value is a ResourceResponse which contains a conversation id which is suitable for use in the message payload and REST API uris.
Most channels only support the semantics of bots initiating a direct message conversation. An example of how to do that would be:
var resource = await connector.conversations.CreateConversation(new
ConversationParameters(){ Bot = bot, members = new ChannelAccount[]
{ new ChannelAccount("user1") } );
await connect.Conversations.SendToConversationAsync(resource.Id,
new Activity() ... ) ;
.