BotFrameworkHttpClient Class

Definition

Caution

Use BotFrameworkAuthentication.CreateBotFrameworkClient() to obtain a client and perform the operations that were accomplished through BotFrameworkHttpClient.

Class for posting activities securely to a bot using BotFramework HTTP protocol.

[System.Obsolete("Use `BotFrameworkAuthentication.CreateBotFrameworkClient()` to obtain a client and perform the operations that were accomplished through `BotFrameworkHttpClient`.", false)]
public class BotFrameworkHttpClient : Microsoft.Bot.Builder.Skills.BotFrameworkClient
[<System.Obsolete("Use `BotFrameworkAuthentication.CreateBotFrameworkClient()` to obtain a client and perform the operations that were accomplished through `BotFrameworkHttpClient`.", false)>]
type BotFrameworkHttpClient = class
    inherit BotFrameworkClient
Public Class BotFrameworkHttpClient
Inherits BotFrameworkClient
Inheritance
BotFrameworkHttpClient
Derived
Attributes

Remarks

This class can be used to securely post activities to a bot using the Bot Framework HTTP protocol. There are 2 usage patterns: * Forwarding activity to a Skill (Bot => Bot as a Skill) which is done via PostActivityAsync(fromBotId, toBotId, endpoint, serviceUrl, activity); * Posting an activity to yourself (External service => Bot) which is done via PostActivityAsync(botId, endpoint, activity) The latter is used by external services such as webjobs that need to post activities to the bot using the bots own credentials.

Constructors

BotFrameworkHttpClient(HttpClient, ICredentialProvider, IChannelProvider, ILogger)

Initializes a new instance of the BotFrameworkHttpClient class.

Properties

AppCredentialMapCache

Gets the Cache for appCredentials to speed up token acquisition (a token is not requested unless is expired). AppCredentials are cached using appId + scope (this last parameter is only used if the app credentials are used to call a skill).

ChannelProvider

Gets the channel provider for this adapter.

CredentialProvider

Gets the credential provider for this adapter.

HttpClient

Gets the HttpClient for this adapter.

Logger

Gets the logger for this adapter.

Methods

BuildCredentialsAsync(String, String)

Logic to build an AppCredentials object to be used to acquire tokens for this HttpClient.

Dispose() (Inherited from BotFrameworkClient)
Dispose(Boolean)

Protected implementation of dispose pattern.

(Inherited from BotFrameworkClient)
PostActivityAsync(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.

PostActivityAsync<T>(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.

Applies to