Language

TeamsBotApplication.Send Method

Definition

Overloads

Name Description
Send(String, TeamsActivity, Uri, AgenticIdentity, CancellationToken)
Obsolete.

Sends an activity proactively to a conversation. When the activity carries a recipient marked as targeted (IsTargeted), it is sent as a targeted message visible only to that recipient.

Send(String, String, Uri, AgenticIdentity, CancellationToken)
Obsolete.

Sends a text message proactively to a conversation.

Send(String, TeamsActivity, Uri, AgenticIdentity, CancellationToken)

Caution

Use SendAsync with a TeamsActivityInput built via new MessageActivityInput() instead.

Sends an activity proactively to a conversation. When the activity carries a recipient marked as targeted (IsTargeted), it is sent as a targeted message visible only to that recipient.

[System.Obsolete("Use SendAsync with a TeamsActivityInput built via new MessageActivityInput() instead.")]
public System.Threading.Tasks.Task<Microsoft.Teams.Core.SendActivityResponse?> Send(string conversationId, Microsoft.Teams.Apps.Schema.TeamsActivity activity, Uri? serviceUrl = default, Microsoft.Teams.Core.Schema.AgenticIdentity? agenticIdentity = default, System.Threading.CancellationToken cancellationToken = default);
[<System.Obsolete("Use SendAsync with a TeamsActivityInput built via new MessageActivityInput() instead.")>]
member this.Send : string * Microsoft.Teams.Apps.Schema.TeamsActivity * Uri * Microsoft.Teams.Core.Schema.AgenticIdentity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Teams.Core.SendActivityResponse>
Public Function Send (conversationId As String, activity As TeamsActivity, Optional serviceUrl As Uri = Nothing, Optional agenticIdentity As AgenticIdentity = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of SendActivityResponse)

Parameters

conversationId
String

The conversation ID to send to. For channel threads, include ;messageid=.

activity
TeamsActivity

The activity to send.

serviceUrl
Uri

The service URL. If null, uses the last-seen service URL from an incoming activity.

agenticIdentity
AgenticIdentity

The agentic identity for user-delegated token acquisition. Extract from the inbound activity's Recipient via GetAgenticIdentity().

cancellationToken
CancellationToken

A cancellation token.

Returns

The response from the send operation.

Attributes

Applies to

Send(String, String, Uri, AgenticIdentity, CancellationToken)

Caution

Use SendAsync instead.

Sends a text message proactively to a conversation.

[System.Obsolete("Use SendAsync instead.")]
public System.Threading.Tasks.Task<Microsoft.Teams.Core.SendActivityResponse?> Send(string conversationId, string text, Uri? serviceUrl = default, Microsoft.Teams.Core.Schema.AgenticIdentity? agenticIdentity = default, System.Threading.CancellationToken cancellationToken = default);
[<System.Obsolete("Use SendAsync instead.")>]
member this.Send : string * string * Uri * Microsoft.Teams.Core.Schema.AgenticIdentity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Teams.Core.SendActivityResponse>
Public Function Send (conversationId As String, text As String, Optional serviceUrl As Uri = Nothing, Optional agenticIdentity As AgenticIdentity = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of SendActivityResponse)

Parameters

conversationId
String

The conversation ID to send to. For channel threads, include ;messageid=.

text
String

The text to send.

serviceUrl
Uri

The service URL. If null, uses the last-seen service URL from an incoming activity.

agenticIdentity
AgenticIdentity

The agentic identity for user-delegated token acquisition. Extract from the inbound activity's Recipient via GetAgenticIdentity().

cancellationToken
CancellationToken

A cancellation token.

Returns

The response from the send operation.

Attributes

Applies to