BotFrameworkHttpClient.PostActivityAsync 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
PostActivityAsync(String, Uri, Activity, CancellationToken) |
Post Activity to the bot using the bot's credentials. |
PostActivityAsync(String, String, Uri, Uri, String, Activity, CancellationToken) |
Forwards an activity to a skill (bot). |
PostActivityAsync<T>(String, Uri, Activity, CancellationToken) |
Post Activity to the bot using the bot's credentials. |
PostActivityAsync<T>(String, String, Uri, Uri, String, Activity, CancellationToken) |
Forwards an activity to a skill (bot). |
PostActivityAsync(String, Uri, Activity, CancellationToken)
Post Activity to the bot using the bot's credentials.
public virtual System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse> PostActivityAsync (string botId, Uri botEndpoint, Microsoft.Bot.Schema.Activity activity, System.Threading.CancellationToken cancellationToken = default);
override this.PostActivityAsync : string * Uri * Microsoft.Bot.Schema.Activity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse>
Public Overridable Function PostActivityAsync (botId As String, botEndpoint As Uri, activity As Activity, Optional cancellationToken As CancellationToken = Nothing) As Task(Of InvokeResponse)
Parameters
- botId
- String
The MicrosoftAppId of the bot.
- botEndpoint
- Uri
The URL of the bot.
- activity
- Activity
activity to post.
- cancellationToken
- CancellationToken
Cancellation token.
Returns
InvokeResponse.
Applies to
PostActivityAsync(String, String, Uri, Uri, String, Activity, CancellationToken)
Forwards an activity to a skill (bot).
public override System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse> PostActivityAsync (string fromBotId, string toBotId, Uri toUrl, Uri serviceUrl, string conversationId, Microsoft.Bot.Schema.Activity activity, System.Threading.CancellationToken cancellationToken = default);
override this.PostActivityAsync : string * string * Uri * Uri * string * Microsoft.Bot.Schema.Activity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse>
Public Overrides Function PostActivityAsync (fromBotId As String, toBotId As String, toUrl As Uri, serviceUrl As Uri, conversationId As String, activity As Activity, Optional cancellationToken As CancellationToken = Nothing) As Task(Of InvokeResponse)
Parameters
- fromBotId
- String
The MicrosoftAppId of the bot sending the activity.
- toBotId
- String
The MicrosoftAppId of the bot receiving the activity.
- toUrl
- Uri
The URL of the bot receiving the activity.
- serviceUrl
- Uri
The callback Url for the skill host.
- conversationId
- String
A conversation ID to use for the conversation with the skill.
- activity
- Activity
activity to forward.
- cancellationToken
- CancellationToken
cancellation Token.
Returns
Async task with optional invokeResponse.
Remarks
NOTE: Forwarding an activity to a skill will flush UserState and ConversationState changes so that skill has accurate state.
Applies to
PostActivityAsync<T>(String, Uri, Activity, CancellationToken)
Post Activity to the bot using the bot's credentials.
public virtual System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse<T>> PostActivityAsync<T> (string botId, Uri botEndpoint, Microsoft.Bot.Schema.Activity activity, System.Threading.CancellationToken cancellationToken = default);
override this.PostActivityAsync : string * Uri * Microsoft.Bot.Schema.Activity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse<'T>>
Public Overridable Function PostActivityAsync(Of T) (botId As String, botEndpoint As Uri, activity As Activity, Optional cancellationToken As CancellationToken = Nothing) As Task(Of InvokeResponse(Of T))
Type Parameters
- T
type of invokeResponse body.
Parameters
- botId
- String
The MicrosoftAppId of the bot.
- botEndpoint
- Uri
The URL of the bot.
- activity
- Activity
activity to post.
- cancellationToken
- CancellationToken
Cancellation token.
Returns
InvokeResponseT
.
Applies to
PostActivityAsync<T>(String, String, Uri, Uri, String, Activity, CancellationToken)
Forwards an activity to a skill (bot).
public override System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse<T>> PostActivityAsync<T> (string fromBotId, string toBotId, Uri toUrl, Uri serviceUrl, string conversationId, Microsoft.Bot.Schema.Activity activity, System.Threading.CancellationToken cancellationToken = default);
override this.PostActivityAsync : string * string * Uri * Uri * string * Microsoft.Bot.Schema.Activity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse<'T>>
Public Overrides Function PostActivityAsync(Of T) (fromBotId As String, toBotId As String, toUrl As Uri, serviceUrl As Uri, conversationId As String, activity As Activity, Optional cancellationToken As CancellationToken = Nothing) As Task(Of InvokeResponse(Of T))
Type Parameters
- T
The type of body in the InvokeResponse.
Parameters
- fromBotId
- String
The MicrosoftAppId of the bot sending the activity.
- toBotId
- String
The MicrosoftAppId of the bot receiving the activity.
- toUrl
- Uri
The URL of the bot receiving the activity.
- serviceUrl
- Uri
The callback Url for the skill host.
- conversationId
- String
A conversation ID to use for the conversation with the skill.
- activity
- Activity
activity to forward.
- cancellationToken
- CancellationToken
cancellation Token.
Returns
Async task with optional invokeResponseT
.
Remarks
NOTE: Forwarding an activity to a skill will flush UserState and ConversationState changes so that skill has accurate state.