Language

ConversationClient.UpdateActivityAsync Method

Definition

Updates an existing activity in a conversation.

public virtual System.Threading.Tasks.Task<Microsoft.Teams.Core.UpdateActivityResponse> UpdateActivityAsync(string conversationId, string activityId, Microsoft.Teams.Core.Schema.CoreActivityInput activity, Uri serviceUrl, bool isTargeted = false, Microsoft.Teams.Core.Http.BotRequestContext? requestContext = default, System.Collections.Generic.Dictionary<string,string>? customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member UpdateActivityAsync : string * string * Microsoft.Teams.Core.Schema.CoreActivityInput * Uri * bool * Microsoft.Teams.Core.Http.BotRequestContext * System.Collections.Generic.Dictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Teams.Core.UpdateActivityResponse>
override this.UpdateActivityAsync : string * string * Microsoft.Teams.Core.Schema.CoreActivityInput * Uri * bool * Microsoft.Teams.Core.Http.BotRequestContext * System.Collections.Generic.Dictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Teams.Core.UpdateActivityResponse>
Public Overridable Function UpdateActivityAsync (conversationId As String, activityId As String, activity As CoreActivityInput, serviceUrl As Uri, Optional isTargeted As Boolean = false, Optional requestContext As BotRequestContext = Nothing, Optional customHeaders As Dictionary(Of String, String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of UpdateActivityResponse)

Parameters

conversationId
String

The ID of the conversation. Cannot be null or whitespace.

activityId
String

The ID of the activity to update. Cannot be null or whitespace.

activity
CoreActivityInput

The updated activity data. Cannot be null.

serviceUrl
Uri

The service URL for the conversation. Cannot be null.

isTargeted
Boolean

Whether this is a targeted activity visible only to a specific recipient.

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 update operation.

Returns

A task that represents the asynchronous operation. The task result contains the response with the ID of the updated activity.

Exceptions

Thrown if the activity could not be updated successfully.

Applies to