From 9ae49782c9376bd1ad3b472109bbe86cd8b4ace5 Mon Sep 17 00:00:00 2001 From: Chris McConnell Date: Wed, 15 Feb 2017 19:48:19 -0800 Subject: [PATCH] Change the prompter so that the state and current field are passed in. This is a breaking change in order to provide more flexibility on output. Several people have run into the need for the state and current field. --- .../FormFlow/FormBuilder.cs | 10 +- .../FormFlow/FormDialog.cs | 26 +- .../Microsoft.Bot.Builder/FormFlow/IForm.cs | 2 +- .../FormFlow/IFormBuilder.cs | 2 +- .../Microsoft.Bot.Builder/FormFlow/IPrompt.cs | 5 +- .../Microsoft.Bot.Builder/FormFlow/Steps.cs | 2 +- .../Microsoft.Bot.Connector.NetCore.XML | 8810 ++++++++--------- .../Microsoft.Bot.Builder.Tests/FormTests.cs | 48 + .../Microsoft.Bot.Builder.Tests.csproj | 3 + .../Scripts/SimpleForm-Preamble.script | 53 + .../Scripts/SimpleForm-Prompter.script | 22 +- 11 files changed, 4545 insertions(+), 4438 deletions(-) create mode 100644 CSharp/Tests/Microsoft.Bot.Builder.Tests/Scripts/SimpleForm-Preamble.script diff --git a/CSharp/Library/Microsoft.Bot.Builder/FormFlow/FormBuilder.cs b/CSharp/Library/Microsoft.Bot.Builder/FormFlow/FormBuilder.cs index 4211fef7c4..b276146902 100644 --- a/CSharp/Library/Microsoft.Bot.Builder/FormFlow/FormBuilder.cs +++ b/CSharp/Library/Microsoft.Bot.Builder/FormFlow/FormBuilder.cs @@ -67,7 +67,7 @@ public virtual IForm Build(Assembly resourceAssembly = null, string resourceN } if (this._form._prompter == null) { - this._form._prompter = async (context, prompt) => + this._form._prompter = async (context, prompt, state, field) => { var preamble = context.MakeMessage(); var promptMessage = context.MakeMessage(); @@ -171,7 +171,7 @@ public virtual IFormBuilder OnCompletion(OnCompletionAsyncDelegate callbac return this; } - public virtual IFormBuilder Prompter(PromptAsyncDelegate prompter) + public virtual IFormBuilder Prompter(PromptAsyncDelegate prompter) { _form._prompter = prompter; return this; @@ -290,7 +290,7 @@ protected internal sealed class Form : IForm internal readonly Fields _fields = new Fields(); internal readonly List> _steps = new List>(); internal OnCompletionAsyncDelegate _completion = null; - internal PromptAsyncDelegate _prompter = null; + internal PromptAsyncDelegate _prompter = null; internal ILocalizer _resources = new Localizer() { Culture = CultureInfo.CurrentUICulture }; public Form() @@ -344,9 +344,9 @@ internal override IReadOnlyList> Steps } } - internal override async Task Prompt(IDialogContext context, FormPrompt prompt) + internal override async Task Prompt(IDialogContext context, FormPrompt prompt, T state, IField field) { - return prompt == null ? prompt : await _prompter(context, prompt); + return prompt == null ? prompt : await _prompter(context, prompt, state, field); } internal override OnCompletionAsyncDelegate Completion diff --git a/CSharp/Library/Microsoft.Bot.Builder/FormFlow/FormDialog.cs b/CSharp/Library/Microsoft.Bot.Builder/FormFlow/FormDialog.cs index cded932e73..68c1279c23 100644 --- a/CSharp/Library/Microsoft.Bot.Builder/FormFlow/FormDialog.cs +++ b/CSharp/Library/Microsoft.Bot.Builder/FormFlow/FormDialog.cs @@ -292,9 +292,9 @@ public async Task MessageReceived(IDialogContext context, IAwaitable> PostAsync = async (prompt) => + Func, Task> PostAsync = async (prompt, step) => { - return await _form.Prompt(context, prompt); + return await _form.Prompt(context, prompt, _state, step.Field); }; Func, IEnumerable, Task> DoStepAsync = async (step, matches) => { @@ -303,12 +303,12 @@ public async Task MessageReceived(IDialogContext context, IAwaitable(_form.Steps[_formState.Step].Name, _form, _state, _formState); if (start) { - lastPrompt = await PostAsync(step.Start(context, _state, _formState)); + lastPrompt = await PostAsync(step.Start(context, _state, _formState), step); waitForMessage = true; } else @@ -361,7 +361,7 @@ public async Task MessageReceived(IDialogContext context, IAwaitable internal abstract FormConfiguration Configuration { get; } internal abstract IReadOnlyList> Steps { get; } internal abstract OnCompletionAsyncDelegate Completion { get; } - internal abstract Task Prompt(IDialogContext context, FormPrompt prompt); + internal abstract Task Prompt(IDialogContext context, FormPrompt prompt, T state, IField field); } } diff --git a/CSharp/Library/Microsoft.Bot.Builder/FormFlow/IFormBuilder.cs b/CSharp/Library/Microsoft.Bot.Builder/FormFlow/IFormBuilder.cs index 25d625382e..3a92357132 100644 --- a/CSharp/Library/Microsoft.Bot.Builder/FormFlow/IFormBuilder.cs +++ b/CSharp/Library/Microsoft.Bot.Builder/FormFlow/IFormBuilder.cs @@ -214,7 +214,7 @@ public interface IFormBuilder /// /// Delegate. /// Modified IFormBuilder. - IFormBuilder Prompter(PromptAsyncDelegate prompter); + IFormBuilder Prompter(PromptAsyncDelegate prompter); /// /// Delegate to call when form is completed. diff --git a/CSharp/Library/Microsoft.Bot.Builder/FormFlow/IPrompt.cs b/CSharp/Library/Microsoft.Bot.Builder/FormFlow/IPrompt.cs index ef9e1b7fc8..d7268410d2 100644 --- a/CSharp/Library/Microsoft.Bot.Builder/FormFlow/IPrompt.cs +++ b/CSharp/Library/Microsoft.Bot.Builder/FormFlow/IPrompt.cs @@ -181,8 +181,11 @@ public override string ToString() /// /// Message context. /// Prompt to be posted. + /// State of the form. + /// Field being prompted or null if not a field. /// Prompt that was posted. - public delegate Task PromptAsyncDelegate(IDialogContext context, FormPrompt prompt); + public delegate Task PromptAsyncDelegate(IDialogContext context, FormPrompt prompt, T state, IField field) + where T : class; public static partial class Extensions { diff --git a/CSharp/Library/Microsoft.Bot.Builder/FormFlow/Steps.cs b/CSharp/Library/Microsoft.Bot.Builder/FormFlow/Steps.cs index 3f44224f33..aa8b725857 100644 --- a/CSharp/Library/Microsoft.Bot.Builder/FormFlow/Steps.cs +++ b/CSharp/Library/Microsoft.Bot.Builder/FormFlow/Steps.cs @@ -843,7 +843,7 @@ public IField Field { get { - throw new NotImplementedException(); + return null; } } diff --git a/CSharp/Library/Microsoft.Bot.Connector.NetCore/Content/Microsoft.Bot.Connector.NetCore.XML b/CSharp/Library/Microsoft.Bot.Connector.NetCore/Content/Microsoft.Bot.Connector.NetCore.XML index f641dcfaa4..8065e7e55b 100644 --- a/CSharp/Library/Microsoft.Bot.Connector.NetCore/Content/Microsoft.Bot.Connector.NetCore.XML +++ b/CSharp/Library/Microsoft.Bot.Connector.NetCore/Content/Microsoft.Bot.Connector.NetCore.XML @@ -1,4405 +1,4405 @@ - - - - Microsoft.Bot.Connector.NetCore - - - - - Client will open given url in the built-in browser. - - - - - Client will post message to bot, so all other participants will see that was posted to the bot and who posted this. - - - - - Client will post message to bot privately, so other participants inside conversation will not see that was posted. - - - - - playback audio container referenced by url - - - - - playback video container referenced by url - - - - - show image referenced by url - - - - - download file referenced by url - - - - - Signin button - - - - - An Activity is the basic communication type for the Bot Framework 3.0 protocol - - - The Activity class contains all properties that individual, more specific activities - could contain. It is a superset type. - - - An Activity is the basic communication type for the Bot Framework 3.0 - protocol - - - - - Content-type for an Activity - - - - - Take a message and create a reply message for it with the routing information - set up to correctly route a reply to the source message - - text you want to reply with - language of your reply - message set up to route back to the sender - - - - Create an instance of the Activity class with IMessageActivity masking - - - - - Create an instance of the Activity class with IContactRelationUpdateActivity masking - - - - - Create an instance of the Activity class with IConversationUpdateActivity masking - - - - - Create an instance of the Activity class with ITypingActivity masking - - - - - Create an instance of the Activity class with IActivity masking - - - - - Create an instance of the Activity class with IEndOfConversationActivity masking - - - - - Create an instance of the Activity class with an IEventActivity masking - - - - - Create an instance of the Activity class with IInvokeActivity masking - - - - - True if the Activity is of the specified activity type - - - - - Return an IMessageActivity mask if this is a message activity - - - - - Return an IContactRelationUpdateActivity mask if this is a contact relation update activity - - - - - Return an IConversationUpdateActivity mask if this is a conversation update activity - - - - - Return an ITypingActivity mask if this is a typing activity - - - - - Return an IEndOfConversationActivity mask if this is an end of conversation activity - - - - - Return an IEventActivity mask if this is an event activity - - - - - Return an IInvokeActivity mask if this is an invoke activity - - - - - Get StateClient appropriate for this activity - - credentials for bot to access state api - alternate serviceurl to use for state service - - - - - - Get StateClient appropriate for this activity - - - - alternate serviceurl to use for state service - - - - - - Check if the message has content - - Returns true if this message has any content to send - - - - Get mentions - - - - - - Is there a mention of Id in the Text Property - - ChannelAccount.Id - true if this id is mentioned in the text - - - - Is there a mention of Recipient.Id in the Text Property - - true if this id is mentioned in the text - - - - Remove recipient mention text from Text property - - new .Text property value - - - - Replace any mention text for given id from Text property - - id to match - new .Text property value - - - - Get channeldata as typed structure - - type to use - typed object or default(TypeT) - - - - Return the "major" portion of the activity - - normalized major portion of the activity, aka message/... will return "message" - - - - Initializes a new instance of the Activity class. - - - - - Initializes a new instance of the Activity class. - - - - - The type of the activity - [message|contactRelationUpdate|converationUpdate|typing|endOfConversation|event|invoke] - - - - - ID of this activity - - - - - UTC Time when message was sent (set by service) - - - - - Local time when message was sent (set by client, Ex: - 2016-09-23T13:07:49.4714686-07:00) - - - - - Service endpoint where operations concerning the activity may be - performed - - - - - ID of the channel where the activity was sent - - - - - Sender address - - - - - Conversation - - - - - (Outbound to bot only) Bot's address that received the message - - - - - Format of text fields [plain|markdown] Default:markdown - - - - - Hint for how to deal with multiple attachments: [list|carousel] - Default:list - - - - - Array of address added - - - - - Array of addresses removed - - - - - Conversations new topic name - - - - - True if the previous history of the channel is disclosed - - - - - The language code of the Text field - - - - - Content for the message - - - - - Text to display if the channel cannot render cards - - - - - Attachments - - - - - Collection of Entity objects, each of which contains metadata - about this activity. Each Entity object is typed. - - - - - Channel-specific payload - - - - - ContactAdded/Removed action - - - - - The original ID this message is a response to - - - - - Open-ended value - - - - - Name of the operation to invoke or the name of the event - - - - - Reference to another conversation or activity - - - - - Types of Activities - - - - - Message from a user -> bot or bot -> User - - - - - Bot added removed to contact list - - - - - This notification is sent when the conversation's properties change, for example the topic name, or when user joins or leaves the group. - - - - - a user is typing - - - - - Bounce a message off of the server without replying or changing it's state - - - - - End a conversation - - - - - NOTE: Trigger activity has been renamed to Event activity - - - - - Asynchronous external event - - - - - Synchronous request to invoke a command - - - - - Delete user data - - - - - Attachments operations. - - - - - Get the URI of an attachment view - - - default is "original" - uri - - - - Get the given attachmentid view as a stream - - attachmentid - view to get (default:original) - stream of attachment - - - - Initializes a new instance of the Attachments class. - - - Reference to the service client. - - - - - Gets a reference to the ConnectorClient - - - - - GetAttachmentInfo - - Get AttachmentInfo structure describing the attachment views - - attachment id - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - GetAttachment - - Get the named view as binary content - - attachment id - - - View id from attachmentInfo - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - Creates an instance of bot authenticator. - - The Microsoft app Id. - The Microsoft app password. - This constructor sets the to - and doesn't disable - the self issued tokens used by emulator. - - - - - Authenticates the incoming request and add the for each - activities to if the request is authenticated. - - The request that should be authenticated. - The activities extracted from request. - The cancellation token. - - - - - Generates response for the request. - - The request. - A response with status code unauthorized. - - - - Get a property from a BotData recorded retrieved using the REST API - - property name to change - property requested or default for type - - - - Set a property on a BotData record retrieved using the REST API - - property name to change - new data - - - - Remove a property from the BotData record - - property name to remove - - - - Initializes a new instance of the BotData class. - - - - - Initializes a new instance of the BotData class. - - - - - - - - - - - - - Creates a new attachment from . - - The instance of . - The generated attachment. - - - - Creates a new attachment from . - - The instance of . - The generated attachment. - - - - Creates a new attachment from . - - The instance of . - The generated attachment. - - - - Creates a new attachment from . - - The instance of . - The generated attachment. - - - - Creates a new attachment from . - - The instance of . - The generated attachment. - - - - Creates a new attachment from . - - The instance of . - The generated attachment. - - - - Creates a new attachment from . - - The instance of . - The generated attachment. - - - - Get the AppId from the Claims Identity - - - - - - - Get the AppPassword from the Claims Identity - - - - - - - Get the MicrosoftAppCredentials using claims in the claims identity - - - - - - - Extension methods for Attachments. - - - - - GetAttachmentInfo - - Get AttachmentInfo structure describing the attachment views - - The operations group for this extension method. - - - attachment id - - - - - GetAttachmentInfo - - Get AttachmentInfo structure describing the attachment views - - The operations group for this extension method. - - - attachment id - - - The cancellation token. - - - - - GetAttachment - - Get the named view as binary content - - The operations group for this extension method. - - - attachment id - - - View id from attachmentInfo - - - - - GetAttachment - - Get the named view as binary content - - The operations group for this extension method. - - - attachment id - - - View id from attachmentInfo - - - The cancellation token. - - - - - GetAttachmentStream - - Get the named view as binary stream - - The operations group for this extension method. - - - attachment id - - - View id from attachmentInfo - - - - - GetAttachmentStreamAsync - - Get the named view as binary content as a stream - - The operations group for this extension method. - - - attachment id - - - View id from attachmentInfo - - - The cancellation token. - - - - - The Bot Connector REST API allows your bot to send and receive - messages to channels configured in the - [Bot Framework Developer Portal](https://dev.botframework.com). The - Connector service uses industry-standard REST - and JSON over HTTPS. - - Client libraries for this REST API are available. See below for a - list. - - Many bots will use both the Bot Connector REST API and the associated - [Bot State REST API](/en-us/restapi/state). The - Bot State REST API allows a bot to store and retrieve state associated - with users and conversations. - - Authentication for both the Bot Connector and Bot State REST APIs is - accomplished with JWT Bearer tokens, and is - described in detail in the [Connector - Authentication](/en-us/restapi/authentication) document. - - # Client Libraries for the Bot Connector REST API - - * [Bot Builder for C#](/en-us/csharp/builder/sdkreference/) - * [Bot Builder for Node.js](/en-us/node/builder/overview/) - * Generate your own from the [Connector API Swagger - file](https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector/Swagger/ConnectorAPI.json) - - © 2016 Microsoft - - - - - The base URI of the service. - - - - - Gets or sets json serialization settings. - - - - - Gets or sets json deserialization settings. - - - - - Subscription credentials which uniquely identify client subscription. - - - - - Gets the IAttachments. - - - - - Gets the IConversations. - - - - - Initializes a new instance of the ConnectorClient class. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the ConnectorClient class. - - - Optional. The http client handler used to handle http transport. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the ConnectorClient class. - - - Optional. The base URI of the service. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the ConnectorClient class. - - - Optional. The base URI of the service. - - - Optional. The http client handler used to handle http transport. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the ConnectorClient class. - - - Required. Subscription credentials which uniquely identify client subscription. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the ConnectorClient class. - - - Required. Subscription credentials which uniquely identify client subscription. - - - Optional. The http client handler used to handle http transport. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the ConnectorClient class. - - - Optional. The base URI of the service. - - - Required. Subscription credentials which uniquely identify client subscription. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the ConnectorClient class. - - - Optional. The base URI of the service. - - - Required. Subscription credentials which uniquely identify client subscription. - - - Optional. The http client handler used to handle http transport. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes client properties. - - - - - Create a new instance of the ConnectorClient class - - Base URI for the Connector service - Optional. Your Microsoft app id. If null, this setting is read from settings["MicrosoftAppId"] - Optional. Your Microsoft app password. If null, this setting is read from settings["MicrosoftAppPassword"] - Optional. The delegating handlers to add to the http client pipeline. - - - - Create a new instance of the ConnectorClient class - - Base URI for the Connector service - Credentials for the Connector service - True, if JwtTokenRefresher should be included; False otherwise. - Optional. The delegating handlers to add to the http client pipeline. - - - - Conversations operations. - - - - - Initializes a new instance of the Conversations class. - - - Reference to the service client. - - - - - Gets a reference to the ConnectorClient - - - - - CreateConversation - - 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) - * Members array contining the members you want to have be 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() ... ) ; - - ``` - - Parameters to create the conversation from - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - SendToConversation - - This method allows you to send an activity to the end of a conversation. - - This is slightly different from ReplyToActivity(). - * SendToConverstion(conversationId) - will append the activity to the end - of the conversation according to the timestamp or semantics of the - channel. - * ReplyToActivity(conversationId,ActivityId) - adds the activity as a - reply to another activity, if the channel supports it. If the channel - does not support nested replies, ReplyToActivity falls back to - SendToConversation. - - Use ReplyToActivity when replying to a specific activity in the - conversation. - - Use SendToConversation in all other cases. - - Activity to send - - - Conversation ID - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - UpdateActivity - - Edit an existing activity. - - Some channels allow you to edit an existing activity to reflect the new - state of a bot conversation. - - For example, you can remove buttons after someone has clicked "Approve" - button. - - Conversation ID - - - activityId to update - - - replacement Activity - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - ReplyToActivity - - This method allows you to reply to an activity. - - This is slightly different from SendToConversation(). - * SendToConverstion(conversationId) - will append the activity to the end - of the conversation according to the timestamp or semantics of the - channel. - * ReplyToActivity(conversationId,ActivityId) - adds the activity as a - reply to another activity, if the channel supports it. If the channel - does not support nested replies, ReplyToActivity falls back to - SendToConversation. - - Use ReplyToActivity when replying to a specific activity in the - conversation. - - Use SendToConversation in all other cases. - - Conversation ID - - - activityId the reply is to (OPTIONAL) - - - Activity to send - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - DeleteActivity - - Delete an existing activity. - - Some channels allow you to delete an existing activity, and if successful - this method will remove the specified activity. - - Conversation ID - - - activityId to delete - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - GetConversationMembers - - Enumerate the members of a converstion. - - This REST API takes a ConversationId and returns an array of - ChannelAccount objects representing the members of the conversation. - - Conversation ID - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - GetActivityMembers - - Enumerate the members of an activity. - - This REST API takes a ConversationId and a ActivityId, returning an array - of ChannelAccount objects representing the members of the particular - activity in the conversation. - - Conversation ID - - - Activity ID - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - UploadAttachment - - Upload an attachment directly into a channel's blob storage. - - This is useful because it allows you to store data in a compliant store - when dealing with enterprises. - - The response is a ResourceResponse which contains an AttachmentId which is - suitable for using with the attachments API. - - Conversation ID - - - Attachment data - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - Extension methods for Conversations. - - - - - CreateConversation - - 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) - * Members array contining the members you want to have be 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() ... ) ; - - ``` - - The operations group for this extension method. - - - Parameters to create the conversation from - - - - - CreateConversation - - 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) - * Members array contining the members you want to have be 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() ... ) ; - - ``` - - The operations group for this extension method. - - - Parameters to create the conversation from - - - The cancellation token. - - - - - SendToConversation - - This method allows you to send an activity to the end of a conversation. - - This is slightly different from ReplyToActivity(). - * SendToConverstion(conversationId) - will append the activity to the end - of the conversation according to the timestamp or semantics of the - channel. - * ReplyToActivity(conversationId,ActivityId) - adds the activity as a - reply to another activity, if the channel supports it. If the channel - does not support nested replies, ReplyToActivity falls back to - SendToConversation. - - Use ReplyToActivity when replying to a specific activity in the - conversation. - - Use SendToConversation in all other cases. - - The operations group for this extension method. - - - Activity to send - - - Conversation ID - - - - - SendToConversation - - This method allows you to send an activity to the end of a conversation. - - This is slightly different from ReplyToActivity(). - * SendToConverstion(conversationId) - will append the activity to the end - of the conversation according to the timestamp or semantics of the - channel. - * ReplyToActivity(conversationId,ActivityId) - adds the activity as a - reply to another activity, if the channel supports it. If the channel - does not support nested replies, ReplyToActivity falls back to - SendToConversation. - - Use ReplyToActivity when replying to a specific activity in the - conversation. - - Use SendToConversation in all other cases. - - The operations group for this extension method. - - - Activity to send - - - Conversation ID - - - The cancellation token. - - - - - UpdateActivity - - Edit an existing activity. - - Some channels allow you to edit an existing activity to reflect the new - state of a bot conversation. - - For example, you can remove buttons after someone has clicked "Approve" - button. - - The operations group for this extension method. - - - Conversation ID - - - activityId to update - - - replacement Activity - - - - - UpdateActivity - - Edit an existing activity. - - Some channels allow you to edit an existing activity to reflect the new - state of a bot conversation. - - For example, you can remove buttons after someone has clicked "Approve" - button. - - The operations group for this extension method. - - - Conversation ID - - - activityId to update - - - replacement Activity - - - The cancellation token. - - - - - ReplyToActivity - - This method allows you to reply to an activity. - - This is slightly different from SendToConversation(). - * SendToConverstion(conversationId) - will append the activity to the end - of the conversation according to the timestamp or semantics of the - channel. - * ReplyToActivity(conversationId,ActivityId) - adds the activity as a - reply to another activity, if the channel supports it. If the channel - does not support nested replies, ReplyToActivity falls back to - SendToConversation. - - Use ReplyToActivity when replying to a specific activity in the - conversation. - - Use SendToConversation in all other cases. - - The operations group for this extension method. - - - Conversation ID - - - activityId the reply is to (OPTIONAL) - - - Activity to send - - - - - ReplyToActivity - - This method allows you to reply to an activity. - - This is slightly different from SendToConversation(). - * SendToConverstion(conversationId) - will append the activity to the end - of the conversation according to the timestamp or semantics of the - channel. - * ReplyToActivity(conversationId,ActivityId) - adds the activity as a - reply to another activity, if the channel supports it. If the channel - does not support nested replies, ReplyToActivity falls back to - SendToConversation. - - Use ReplyToActivity when replying to a specific activity in the - conversation. - - Use SendToConversation in all other cases. - - The operations group for this extension method. - - - Conversation ID - - - activityId the reply is to (OPTIONAL) - - - Activity to send - - - The cancellation token. - - - - - DeleteActivity - - Delete an existing activity. - - Some channels allow you to delete an existing activity, and if successful - this method will remove the specified activity. - - The operations group for this extension method. - - - Conversation ID - - - activityId to delete - - - - - DeleteActivity - - Delete an existing activity. - - Some channels allow you to delete an existing activity, and if successful - this method will remove the specified activity. - - The operations group for this extension method. - - - Conversation ID - - - activityId to delete - - - The cancellation token. - - - - - GetConversationMembers - - Enumerate the members of a converstion. - - This REST API takes a ConversationId and returns an array of - ChannelAccount objects representing the members of the conversation. - - The operations group for this extension method. - - - Conversation ID - - - - - GetConversationMembers - - Enumerate the members of a converstion. - - This REST API takes a ConversationId and returns an array of - ChannelAccount objects representing the members of the conversation. - - The operations group for this extension method. - - - Conversation ID - - - The cancellation token. - - - - - GetActivityMembers - - Enumerate the members of an activity. - - This REST API takes a ConversationId and a ActivityId, returning an array - of ChannelAccount objects representing the members of the particular - activity in the conversation. - - The operations group for this extension method. - - - Conversation ID - - - Activity ID - - - - - GetActivityMembers - - Enumerate the members of an activity. - - This REST API takes a ConversationId and a ActivityId, returning an array - of ChannelAccount objects representing the members of the particular - activity in the conversation. - - The operations group for this extension method. - - - Conversation ID - - - Activity ID - - - The cancellation token. - - - - - UploadAttachment - - Upload an attachment directly into a channel's blob storage. - - This is useful because it allows you to store data in a compliant store - when dealing with enterprises. - - The response is a ResourceResponse which contains an AttachmentId which is - suitable for using with the attachments API. - - The operations group for this extension method. - - - Conversation ID - - - Attachment data - - - - - UploadAttachment - - Upload an attachment directly into a channel's blob storage. - - This is useful because it allows you to store data in a compliant store - when dealing with enterprises. - - The response is a ResourceResponse which contains an AttachmentId which is - suitable for using with the attachments API. - - The operations group for this extension method. - - - Conversation ID - - - Attachment data - - - The cancellation token. - - - - - Create a new direct conversation between a bot and a user - - The operations group for this extension method. - Bot to create conversation from - User to create conversation with - (OPTIONAL) initial message to send to the new conversation - - - - Create a new direct conversation between a bot and a user - - The operations group for this extension method. - Bot to create conversation from - User to create conversation with - (OPTIONAL) initial message to send to the new conversation - The cancellation token. - - - - Create a new direct conversation between a bot and a user - - The operations group for this extension method. - Bot to create conversation from - User to create conversation with - (OPTIONAL) initial message to send to the new conversation - - - - Create a new direct conversation between a bot and a user - - The operations group for this extension method. - Bot to create conversation from - User to create conversation with - (OPTIONAL) initial message to send to the new conversation - The cancellation token - - - - Send an activity to a conversation - - - The operations group for this extension method. - - - Activity to send - - - - - Send an activity to a conversation - - - The operations group for this extension method. - - - Activity to send - - - The cancellation token. - - - - - Replyto an activity in an existing conversation - - - The operations group for this extension method. - - - Activity to send - - - - - Reply to an activity in an existing conversation - - - The operations group for this extension method. - - - Activity to send - - - The cancellation token. - - - - - Update an activity in an existing conversation - - - The operations group for this extension method. - - - Activity to update - - - - - Update an activity in an existing conversation - - - The operations group for this extension method. - - - Activity to update - - - The cancellation token. - - - - - Attachments operations. - - - - - GetAttachmentInfo - - Get AttachmentInfo structure describing the attachment views - - attachment id - - - The headers that will be added to request. - - - The cancellation token. - - - - - GetAttachment - - Get the named view as binary content - - attachment id - - - View id from attachmentInfo - - - The headers that will be added to request. - - - The cancellation token. - - - - - The Bot Connector REST API allows your bot to send and receive - messages to channels configured in the - [Bot Framework Developer Portal](https://dev.botframework.com). The - Connector service uses industry-standard REST - and JSON over HTTPS. - - Client libraries for this REST API are available. See below for a - list. - - Many bots will use both the Bot Connector REST API and the associated - [Bot State REST API](/en-us/restapi/state). The - Bot State REST API allows a bot to store and retrieve state associated - with users and conversations. - - Authentication for both the Bot Connector and Bot State REST APIs is - accomplished with JWT Bearer tokens, and is - described in detail in the [Connector - Authentication](/en-us/restapi/authentication) document. - - # Client Libraries for the Bot Connector REST API - - * [Bot Builder for C#](/en-us/csharp/builder/sdkreference/) - * [Bot Builder for Node.js](/en-us/node/builder/overview/) - * Generate your own from the [Connector API Swagger - file](https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector/Swagger/ConnectorAPI.json) - - © 2016 Microsoft - - - - - The base URI of the service. - - - - - Gets or sets json serialization settings. - - - - - Gets or sets json deserialization settings. - - - - - Subscription credentials which uniquely identify client - subscription. - - - - - Gets the IAttachments. - - - - - Gets the IConversations. - - - - - Conversations operations. - - - - - CreateConversation - - 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) - * Members array containing the members you want to have be 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() ... ) ; - - ``` - - Parameters to create the conversation from - - - The headers that will be added to request. - - - The cancellation token. - - - - - SendToConversation - - This method allows you to send an activity to the end of a - conversation. - - This is slightly different from ReplyToActivity(). - * SendToConverstion(conversationId) - will append the activity to - the end of the conversation according to the timestamp or - semantics of the channel. - * ReplyToActivity(conversationId,ActivityId) - adds the activity - as a reply to another activity, if the channel supports it. If - the channel does not support nested replies, ReplyToActivity - falls back to SendToConversation. - - Use ReplyToActivity when replying to a specific activity in the - conversation. - - Use SendToConversation in all other cases. - - Activity to send - - - Conversation ID - - - The headers that will be added to request. - - - The cancellation token. - - - - - UpdateActivity - - Edit an existing activity. - - Some channels allow you to edit an existing activity to reflect - the new state of a bot conversation. - - For example, you can remove buttons after someone has clicked - "Approve" button. - - Conversation ID - - - activityId to update - - - replacement Activity - - - The headers that will be added to request. - - - The cancellation token. - - - - - ReplyToActivity - - This method allows you to reply to an activity. - - This is slightly different from SendToConversation(). - * SendToConverstion(conversationId) - will append the activity to - the end of the conversation according to the timestamp or - semantics of the channel. - * ReplyToActivity(conversationId,ActivityId) - adds the activity - as a reply to another activity, if the channel supports it. If - the channel does not support nested replies, ReplyToActivity - falls back to SendToConversation. - - Use ReplyToActivity when replying to a specific activity in the - conversation. - - Use SendToConversation in all other cases. - - Conversation ID - - - activityId the reply is to (OPTIONAL) - - - Activity to send - - - The headers that will be added to request. - - - The cancellation token. - - - - - DeleteActivity - - Delete an existing activity. - - Some channels allow you to delete an existing activity, and if - successful this method will remove the specified activity. - - Conversation ID - - - activityId to delete - - - The headers that will be added to request. - - - The cancellation token. - - - - - GetConversationMembers - - Enumerate the members of a converstion. - - This REST API takes a ConversationId and returns an array of - ChannelAccount objects representing the members of the - conversation. - - Conversation ID - - - The headers that will be added to request. - - - The cancellation token. - - - - - GetActivityMembers - - Enumerate the members of an activity. - - This REST API takes a ConversationId and a ActivityId, returning - an array of ChannelAccount objects representing the members of - the particular activity in the conversation. - - Conversation ID - - - Activity ID - - - The headers that will be added to request. - - - The cancellation token. - - - - - UploadAttachment - - Upload an attachment directly into a channel's blob storage. - - This is useful because it allows you to store data in a compliant - store when dealing with enterprises. - - The response is a ResourceResponse which contains an AttachmentId - which is suitable for using with the attachments API. - - Conversation ID - - - Attachment data - - - The headers that will be added to request. - - - The cancellation token. - - - - - A thumbnail card (card with a single, small thumbnail image) - - - - - Initializes a new instance of the ThumbnailCard class. - - - - - Initializes a new instance of the ThumbnailCard class. - - - - - Title of the card - - - - - Subtitle of the card - - - - - Text for the card - - - - - Array of images for the card - - - - - Set of actions applicable to the current card - - - - - This action will be activated when user taps on the card itself - - - - - A Hero card (card with a single, large image) - - - - - Initializes a new instance of the HeroCard class. - - - - - Initializes a new instance of the HeroCard class. - - - - - Title of the card - - - - - Subtitle of the card - - - - - Text for the card - - - - - Array of images for the card - - - - - Set of actions applicable to the current card - - - - - This action will be activated when user taps on the card itself - - - - - A receipt card - - - - - Initializes a new instance of the ReceiptCard class. - - - - - Initializes a new instance of the ReceiptCard class. - - - - - Title of the card - - - - - Array of Receipt Items - - - - - Array of Fact Objects Array of key-value pairs. - - - - - This action will be activated when user taps on the card - - - - - Total amount of money paid (or should be paid) - - - - - Total amount of TAX paid(or should be paid) - - - - - Total amount of VAT paid(or should be paid) - - - - - Set of actions applicable to the current card - - - - - A card representing a request to sign in - - - - - Initializes a new instance of the SigninCard class. - - - - - Initializes a new instance of the SigninCard class. - - - - - Text for signin request - - - - - Action to use to perform signin - - - - - Creates a - - The - The signin button label. - The sigin url. - The created sigin card. - - - - An animation card (Ex: gif or short video clip) - - - - - Initializes a new instance of the AnimationCard class. - - - - - Initializes a new instance of the AnimationCard class. - - - - - Title of the card - - - - - Subtitle of the card - - - - - Text of the card - - - - - Thumbnail placeholder - - - - - Array of media Url objects - - - - - Set of actions applicable to the current card - - - - - Is it OK for this content to be shareable with others - (default:true) - - - - - Should the client loop playback at end of content (default:true) - - - - - Should the client automatically start playback of video in this - card (default:true) - - - - - A audio card - - - - - Initializes a new instance of the AudioCard class. - - - - - Initializes a new instance of the AudioCard class. - - - - - Title of the card - - - - - Subtitle of the card - - - - - Text of the card - - - - - Thumbnail placeholder - - - - - Array of media Url objects - - - - - Set of actions applicable to the current card - - - - - Is it OK for this content to be shareable with others - (default:true) - - - - - Should the client loop playback at end of content (default:true) - - - - - Should the client automatically start playback of video in this - card (default:true) - - - - - Aspect ratio of thumbnail/media placeholder, allowed values are - "16x9" and "9x16" - - - - - A video card - - - - - Initializes a new instance of the VideoCard class. - - - - - Initializes a new instance of the VideoCard class. - - - - - Aspect ratio (16:9)(4:3) - - - - - Title of the card - - - - - Subtitle of the card - - - - - Text of the card - - - - - Thumbnail placeholder - - - - - Array of media Url objects - - - - - Set of actions applicable to the current card - - - - - Is it OK for this content to be shareable with others - (default:true) - - - - - Should the client loop playback at end of content (default:true) - - - - - Should the client automatically start playback of video in this - card (default:true) - - - - - An attachment within an activity - - - - - Initializes a new instance of the Attachment class. - - - - - Initializes a new instance of the Attachment class. - - - - - mimetype/Contenttype for the file - - - - - Content Url - - - - - Embedded content - - - - - (OPTIONAL) The name of the attachment - - - - - (OPTIONAL) Thumbnail associated with attachment - - - - - Attachment data - - - - - Initializes a new instance of the AttachmentData class. - - - - - Initializes a new instance of the AttachmentData class. - - - - - content type of the attachmnet - - - - - Name of the attachment - - - - - original content - - - - - Thumbnail - - - - - Metdata for an attachment - - - - - Initializes a new instance of the AttachmentInfo class. - - - - - Initializes a new instance of the AttachmentInfo class. - - - - - Name of the attachment - - - - - ContentType of the attachment - - - - - attachment views - - - - - Attachment View name and size - - - - - Initializes a new instance of the AttachmentView class. - - - - - Initializes a new instance of the AttachmentView class. - - - - - content type of the attachmnet - - - - - Name of the attachment - - - - - An action on a card - - - - - Initializes a new instance of the CardAction class. - - - - - Initializes a new instance of the CardAction class. - - - - - Defines the type of action implemented by this button. - - - - - Text description which appear on the button. - - - - - URL Picture which will appear on the button, next to text label. - - - - - Supplementary parameter for action. Content of this property - depends on the ActionType - - - - - An image on a card - - - - - Initializes a new instance of the CardImage class. - - - - - Initializes a new instance of the CardImage class. - - - - - URL Thumbnail image for major content property. - - - - - Image description intended for screen readers - - - - - Action assigned to specific Attachment.E.g.navigate to specific - URL or play/open media content - - - - - Channel account information needed to route a message - - - - - Initializes a new instance of the ChannelAccount class. - - - - - Initializes a new instance of the ChannelAccount class. - - - - - Channel id for the user or bot on this channel (Example: - joe@smith.com, or @joesmith or 123456) - - - - - Display friendly name - - - - - Channel account information for a conversation - - - - - Initializes a new instance of the ConversationAccount class. - - - - - Initializes a new instance of the ConversationAccount class. - - - - - Is this a reference to a group - - - - - Channel id for the user or bot on this channel (Example: - joe@smith.com, or @joesmith or 123456) - - - - - Display friendly name - - - - - Parameters for creating a new conversation - - - - - Initializes a new instance of the ConversationParameters class. - - - - - Initializes a new instance of the ConversationParameters class. - - - - - IsGroup - - - - - The bot address for this conversation - - - - - Members to add to the conversation - - - - - (Optional) Topic of the conversation (if supported by the channel) - - - - - (Optional) When creating a new conversation, use this activity as - the intial message to the conversation - - - - - Channel specific payload for creating the conversation - - - - - An object relating to a particular point in a conversation - - - - - Initializes a new instance of the ConversationReference class. - - - - - Initializes a new instance of the ConversationReference class. - - - - - (Optional) ID of the activity to refer to - - - - - (Optional) User participating in this conversation - - - - - Bot participating in this conversation - - - - - Conversation reference - - - - - Channel ID - - - - - Service endpoint where operations concerning the referenced - conversation may be performed - - - - - A response containing a resource - - - - - Initializes a new instance of the ConversationResourceResponse - class. - - - - - Initializes a new instance of the ConversationResourceResponse - class. - - - - - ID of the Activity (if sent) - - - - - Service endpoint where operations concerning the conversation may - be performed - - - - - Id of the resource - - - - - Object of schema.org types - - - - - Initializes a new instance of the Entity class. - - - - - Initializes a new instance of the Entity class. - - - - - Entity Type (typically from schema.org types) - - - - - Retrieve internal payload. - - - - - - - Set internal payload. - - - - - - - Object representing error information - - - - - Initializes a new instance of the Error class. - - - - - Initializes a new instance of the Error class. - - - - - Error code - - - - - Error message - - - - - An HTTP API response - - - - - Initializes a new instance of the ErrorResponse class. - - - - - Initializes a new instance of the ErrorResponse class. - - - - - Error message - - - - - Set of key-value pairs. Advantage of this section is that key and - value properties will be - rendered with default style information with some - delimiter between them. So there is no need for developer to specify - style information. - - - - - Initializes a new instance of the Fact class. - - - - - Initializes a new instance of the Fact class. - - - - - The key for this Fact - - - - - The value for this Fact - - - - - GeoCoordinates (entity type: "https://schema.org/GeoCoordinates") - - - - - Initializes a new instance of the GeoCoordinates class. - - - - - Initializes a new instance of the GeoCoordinates class. - - - - - Elevation of the location [WGS - 84](https://en.wikipedia.org/wiki/World_Geodetic_System) - - - - - Latitude of the location [WGS - 84](https://en.wikipedia.org/wiki/World_Geodetic_System) - - - - - Longitude of the location [WGS - 84](https://en.wikipedia.org/wiki/World_Geodetic_System) - - - - - The type of the thing - - - - - The name of the thing - - - - - MediaUrl data - - - - - Initializes a new instance of the MediaUrl class. - - - - - Initializes a new instance of the MediaUrl class. - - - - - Url for the media - - - - - Optional profile hint to the client to differentiate multiple - MediaUrl objects from each other - - - - - Place (entity type: "https://schema.org/Place") - - - - - Initializes a new instance of the Place class. - - - - - Initializes a new instance of the Place class. - - - - - Address of the place (may be `string` or complex object of type - `PostalAddress`) - - - - - Geo coordinates of the place (may be complex object of type - `GeoCoordinates` or `GeoShape`) - - - - - Map to the place (may be `string` (URL) or complex object of type - `Map`) - - - - - The type of the thing - - - - - The name of the thing - - - - - An item on a receipt card - - - - - Initializes a new instance of the ReceiptItem class. - - - - - Initializes a new instance of the ReceiptItem class. - - - - - Title of the Card - - - - - Subtitle appears just below Title field, differs from Title in - font styling only - - - - - Text field appears just below subtitle, differs from Subtitle in - font styling only - - - - - Image - - - - - Amount with currency - - - - - Number of items of given kind - - - - - This action will be activated when user taps on the Item bubble. - - - - - A response containing a resource ID - - - - - Initializes a new instance of the ResourceResponse class. - - - - - Initializes a new instance of the ResourceResponse class. - - - - - Id of the resource - - - - - Object describing a media thumbnail - - - - - Initializes a new instance of the ThumbnailUrl class. - - - - - Initializes a new instance of the ThumbnailUrl class. - - - - - url pointing to an thumbnail to use for media content - - - - - Alt text to display for screen readers on the thumbnail image - - - - - Bot added to user contacts - - - - - Bot removed from user contacts - - - - - Validate AppId - - - true if it is a valid AppId for the controller - - - - Get the app password for a given bot appId, if it is not a valid appId, return Null - - bot appid - password or null for invalid appid - - - - Checks if bot authentication is disabled. - - true if bot authentication is disabled. - - - - Static credential provider which has the appid and password static - - - - - Credential provider which uses to lookup appId and password - - - - - Error codes to communicate when throwing an APIException - - - - - Other error, not specified - - - - - Bad argument - - - - - Error parsing request - - - - - Mandatory property was not specified - - - - - Message exceeded size limits - - - - - add Bearer authorization token for making API calls - - The http client - (default)Setting["microsoftAppId"] - (default)Setting["microsoftAppPassword"] - HttpClient with Bearer Authorization header - - - - Shared properties for all activities - - - - - Activity type - - - - - Id for the activity - - - - - ServiceUrl - - - - - UTC Time when message was sent - - - - - Client Time when message was sent Ex: 2016-09-23T13:07:49.4714686-07:00 - - - - - Channel this activity is associated with - - - - - Sender address data - - - - - Address for the conversation that this activity is associated with - - - - - Address that received the message - - - - - The original id this message is a response to - - - - - Channel specific payload - - - Some channels will provide channel specific data. - - For a message originating in the channel it might provide the original native schema object for the channel. - - For a message coming into the channel it might accept a payload allowing you to create a "native" response for the channel. - - Example: - * Email - The Email Channel will put the original Email metadata into the ChannelData object for outgoing messages, and will accep - on incoming message a Subject property, and a HtmlBody which can contain Html. - - The channel data essentially allows a bot to have access to native functionality on a per channel basis. - - - - - Return IMessageActivity if this is a message activity, null otherwise - - - - - Return IContactRelationUpdateActivity if this is a contactRelationUpdate activity, null otherwise - - - - - Return IConversationUpdateActivity if this is a conversationUpdate activity, null otherwise - - - - - Return ITypingActivity if this is a typing activity, null otherwise - - - - - Return IEndOfConversationActivity if this is an end-of-conversation activity, null otherwise - - - - - Returns IEventActivity if this is an event activity, null otherwise - - - - - Returns IInvokeActivity if this is an invoke activity, null otherwise - - - - - A user has added a bot to their contact list, removed the bot from their contact list, or otherwise changed the relationship between user and bot - - - - - add|remove - - - - - The referenced conversation has been updated - - - - - Members added to the conversation - - - - - Members removed from the conversation - - - - - The conversation's updated topic name - - - - - True if prior history of the channel is disclosed - - - - - Conversation is ending, or a request to end the conversation - - - - - Asynchronous external event - - - - - Name of the event - - - - - Open-ended value - - - - - Reference to another conversation or activity - - - - - NOTE: Trigger activity has been renamed to Event activity - - - - - Synchronous request to invoke an operation - - - - - Name of the operation to invoke - - - - - Open-ended value - - - - - Reference to another conversation or activity - - - - - A message in a conversation - - - - - The language code of the Text field - - - See https://msdn.microsoft.com/en-us/library/hh456380.aspx for a list of valid language codes - - - - - Content for the message - - - - - Text to display if the channel cannot render cards - - - - - Format of text fields [plain|markdown] Default:markdown - - - - - Hint for how to deal with multiple attachments: [list|carousel] Default:list - - - - - Attachments - - - - - Collection of Entity objects, each of which contains metadata about this activity. Each Entity object is typed. - - - - - True if this activity has text, attachments, or channelData - - - - - Get channeldata as typed structure - - type to use - typed object or default(TypeT) - - - - Get mentions - - - - - The From address is typing - - - - - Configuration for JWT tokens - - - - - TO CHANNEL FROM BOT: Login URL - - - - - TO CHANNEL FROM BOT: OAuth scope to request - - - - - TO BOT FROM CHANNEL: OpenID metadata document for tokens coming from MSA - - - - - TO BOT FROM CHANNEL: Token validation parameters when connecting to a bot - - - - - TO BOT FROM EMULATOR: OpenID metadata document for tokens coming from MSA - - - - - TO BOT FROM EMULATOR: Token validation parameters when connecting to a channel - - - - - Shared of OpenIdConnect configuration managers (one per metadata URL) - - - - - Token validation parameters for this instance - - - - - OpenIdConnect configuration manager for this instances - - - - - - - - - Initializes a new instance of the Entity class. - - - - - The key for Microsoft app Id. - - - - - The key for Microsoft app Password. - - - - - Adds the host of service url to trusted hosts. - - The service url - The expiration time after which this service url is not trusted anymore - If expiration time is not provided, the expiration time will DateTime.UtcNow.AddDays(1). - - - - Checks if the service url is for a trusted host or not. - - The service url - True if the host of the service url is trusted; False otherwise. - - - - Apply the credentials to the HTTP request. - - The HTTP request.Cancellation token. - - - - BotState operations. - - - - - Initializes a new instance of the BotState class. - - - Reference to the service client. - - - - - Gets a reference to the StateClient - - - - - GetUserData - - Get a bots data for the user across all conversations - - channelId - - - id for the user on the channel - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - SetUserData - - Update the bot's data for a user - - channelId - - - id for the user on the channel - - - the new botdata - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - DeleteStateForUser - - Delete all data for a user in a channel (UserData and - PrivateConversationData) - - channelId - - - id for the user on the channel - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - GetConversationData - - get the bots data for all users in a conversation - - the channelId - - - The id for the conversation on the channel - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - SetConversationData - - Update the bot's data for all users in a conversation - - channelId - - - The id for the conversation on the channel - - - the new botdata - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - GetPrivateConversationData - - get bot's data for a single user in a conversation - - channelId - - - The id for the conversation on the channel - - - id for the user on the channel - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - SetPrivateConversationData - - Update the bot's data for a single user in a conversation - - channelId - - - The id for the conversation on the channel - - - id for the user on the channel - - - the new botdata - - - Headers that will be added to request. - - - The cancellation token. - - - A response object containing the response body and response headers. - - - - - Extension methods for BotState. - - - - - GetUserData - - Get a bots data for the user across all conversations - - The operations group for this extension method. - - - channelId - - - id for the user on the channel - - - - - GetUserData - - Get a bots data for the user across all conversations - - The operations group for this extension method. - - - channelId - - - id for the user on the channel - - - The cancellation token. - - - - - SetUserData - - Update the bot's data for a user - - The operations group for this extension method. - - - channelId - - - id for the user on the channel - - - the new botdata - - - - - SetUserData - - Update the bot's data for a user - - The operations group for this extension method. - - - channelId - - - id for the user on the channel - - - the new botdata - - - The cancellation token. - - - - - DeleteStateForUser - - Delete all data for a user in a channel (UserData and - PrivateConversationData) - - The operations group for this extension method. - - - channelId - - - id for the user on the channel - - - - - DeleteStateForUser - - Delete all data for a user in a channel (UserData and - PrivateConversationData) - - The operations group for this extension method. - - - channelId - - - id for the user on the channel - - - The cancellation token. - - - - - GetConversationData - - get the bots data for all users in a conversation - - The operations group for this extension method. - - - the channelId - - - The id for the conversation on the channel - - - - - GetConversationData - - get the bots data for all users in a conversation - - The operations group for this extension method. - - - the channelId - - - The id for the conversation on the channel - - - The cancellation token. - - - - - SetConversationData - - Update the bot's data for all users in a conversation - - The operations group for this extension method. - - - channelId - - - The id for the conversation on the channel - - - the new botdata - - - - - SetConversationData - - Update the bot's data for all users in a conversation - - The operations group for this extension method. - - - channelId - - - The id for the conversation on the channel - - - the new botdata - - - The cancellation token. - - - - - GetPrivateConversationData - - get bot's data for a single user in a conversation - - The operations group for this extension method. - - - channelId - - - The id for the conversation on the channel - - - id for the user on the channel - - - - - GetPrivateConversationData - - get bot's data for a single user in a conversation - - The operations group for this extension method. - - - channelId - - - The id for the conversation on the channel - - - id for the user on the channel - - - The cancellation token. - - - - - SetPrivateConversationData - - Update the bot's data for a single user in a conversation - - The operations group for this extension method. - - - channelId - - - The id for the conversation on the channel - - - id for the user on the channel - - - the new botdata - - - - - SetPrivateConversationData - - Update the bot's data for a single user in a conversation - - The operations group for this extension method. - - - channelId - - - The id for the conversation on the channel - - - id for the user on the channel - - - the new botdata - - - The cancellation token. - - - - - BotState operations. - - - - - GetUserData - - Get a bots data for the user across all conversations - - channelId - - - id for the user on the channel - - - The headers that will be added to request. - - - The cancellation token. - - - - - SetUserData - - Update the bot's data for a user - - channelId - - - id for the user on the channel - - - the new botdata - - - The headers that will be added to request. - - - The cancellation token. - - - - - DeleteStateForUser - - Delete all data for a user in a channel (UserData and - PrivateConversationData) - - channelId - - - id for the user on the channel - - - The headers that will be added to request. - - - The cancellation token. - - - - - GetConversationData - - get the bots data for all users in a conversation - - the channelId - - - The id for the conversation on the channel - - - The headers that will be added to request. - - - The cancellation token. - - - - - SetConversationData - - Update the bot's data for all users in a conversation - - channelId - - - The id for the conversation on the channel - - - the new botdata - - - The headers that will be added to request. - - - The cancellation token. - - - - - GetPrivateConversationData - - get bot's data for a single user in a conversation - - channelId - - - The id for the conversation on the channel - - - id for the user on the channel - - - The headers that will be added to request. - - - The cancellation token. - - - - - SetPrivateConversationData - - Update the bot's data for a single user in a conversation - - channelId - - - The id for the conversation on the channel - - - id for the user on the channel - - - the new botdata - - - The headers that will be added to request. - - - The cancellation token. - - - - - The Bot State REST API allows your bot to store and retrieve state - associated with conversations conducted through - the [Bot Connector REST API](/en-us/restapi/connector). The Bot State - REST API uses REST and HTTPS to send and receive - encoded content that your bot controls. - - Client libraries for this REST API are available. See below for a - list. - - Your bot may store data for a user, a conversation, or a single user - within a conversation (called "private" data). - Each payload may be up to 32 kilobytes in size. The data may be - removed by the bot or upon a user's request, e.g. - if the user requests the channel to inform the bot (and therefore, the - Bot Framework) to delete the user's data. - - The Bot State REST API is only useful in conjunction with the Bot - Connector REST API. - - Authentication for both the Bot State and Bot Connector REST APIs is - accomplished with JWT Bearer tokens, and is - described in detail in the [Connector - Authentication](/en-us/restapi/authentication) document. - - # Client Libraries for the Bot State REST API - - * [Bot Builder for C#](/en-us/csharp/builder/sdkreference/) - * [Bot Builder for Node.js](/en-us/node/builder/overview/) - * Generate your own from the [State API Swagger - file](https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector/Swagger/StateAPI.json) - - © 2016 Microsoft - - - - - The base URI of the service. - - - - - Gets or sets json serialization settings. - - - - - Gets or sets json deserialization settings. - - - - - Subscription credentials which uniquely identify client - subscription. - - - - - Gets the IBotState. - - - - - Initializes a new instance of the APIResponse class. - - - - - Initializes a new instance of the APIResponse class. - - - - - - - - - The Bot State REST API allows your bot to store and retrieve state - associated with conversations conducted through - the [Bot Connector REST API](/en-us/restapi/connector). The Bot State - REST API uses REST and HTTPS to send and receive - encoded content that your bot controls. - - Client libraries for this REST API are available. See below for a - list. - - Your bot may store data for a user, a conversation, or a single user - within a conversation (called "private" data). - Each payload may be up to 32 kilobytes in size. The data may be - removed by the bot or upon a user's request, e.g. - if the user requests the channel to inform the bot (and therefore, the - Bot Framework) to delete the user's data. - - The Bot State REST API is only useful in conjunction with the Bot - Connector REST API. - - Authentication for both the Bot State and Bot Connector REST APIs is - accomplished with JWT Bearer tokens, and is - described in detail in the [Connector - Authentication](/en-us/restapi/authentication) document. - - # Client Libraries for the Bot State REST API - - * [Bot Builder for C#](/en-us/csharp/builder/sdkreference/) - * [Bot Builder for Node.js](/en-us/node/builder/overview/) - * Generate your own from the [State API Swagger - file](https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector/Swagger/StateAPI.json) - - © 2016 Microsoft - - - - - The base URI of the service. - - - - - Gets or sets json serialization settings. - - - - - Gets or sets json deserialization settings. - - - - - Subscription credentials which uniquely identify client subscription. - - - - - Gets the IBotState. - - - - - Initializes a new instance of the StateClient class. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the StateClient class. - - - Optional. The http client handler used to handle http transport. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the StateClient class. - - - Optional. The base URI of the service. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the StateClient class. - - - Optional. The base URI of the service. - - - Optional. The http client handler used to handle http transport. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the StateClient class. - - - Required. Subscription credentials which uniquely identify client subscription. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the StateClient class. - - - Required. Subscription credentials which uniquely identify client subscription. - - - Optional. The http client handler used to handle http transport. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the StateClient class. - - - Optional. The base URI of the service. - - - Required. Subscription credentials which uniquely identify client subscription. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes a new instance of the StateClient class. - - - Optional. The base URI of the service. - - - Required. Subscription credentials which uniquely identify client subscription. - - - Optional. The http client handler used to handle http transport. - - - Optional. The delegating handlers to add to the http client pipeline. - - - - - Initializes client properties. - - - - - Create a new instance of the StateClient class - - Base URI for the State service - Optional. Your Microsoft app id. If null, this setting is read from settings["MicrosoftAppId"] - Optional. Your Microsoft app password. If null, this setting is read from settings["MicrosoftAppPassword"] - Optional. The delegating handlers to add to the http client pipeline. - - - - Create a new instance of the StateClient class - - Base URI for the State service - Credentials for the Connector service - True, if JwtTokenRefresher should be included; False otherwise. - Optional. The delegating handlers to add to the http client pipeline. - - - - Create a new instance of the StateClient class - - This constructor will use https://state.botframework.com as the baseUri - Credentials for the Connector service - True, if JwtTokenRefresher should be included; False otherwise. - Optional. The delegating handlers to add to the http client pipeline. - - - - Default- interpret text fields as markdown - - - - - Plain text (do not interpret as anything) - - - - - B, I, S, U, A NOTE: Only supported on Skype for now - - - - + + + + Microsoft.Bot.Connector.NetCore + + + + + Client will open given url in the built-in browser. + + + + + Client will post message to bot, so all other participants will see that was posted to the bot and who posted this. + + + + + Client will post message to bot privately, so other participants inside conversation will not see that was posted. + + + + + playback audio container referenced by url + + + + + playback video container referenced by url + + + + + show image referenced by url + + + + + download file referenced by url + + + + + Signin button + + + + + An Activity is the basic communication type for the Bot Framework 3.0 protocol + + + The Activity class contains all properties that individual, more specific activities + could contain. It is a superset type. + + + An Activity is the basic communication type for the Bot Framework 3.0 + protocol + + + + + Content-type for an Activity + + + + + Take a message and create a reply message for it with the routing information + set up to correctly route a reply to the source message + + text you want to reply with + language of your reply + message set up to route back to the sender + + + + Create an instance of the Activity class with IMessageActivity masking + + + + + Create an instance of the Activity class with IContactRelationUpdateActivity masking + + + + + Create an instance of the Activity class with IConversationUpdateActivity masking + + + + + Create an instance of the Activity class with ITypingActivity masking + + + + + Create an instance of the Activity class with IActivity masking + + + + + Create an instance of the Activity class with IEndOfConversationActivity masking + + + + + Create an instance of the Activity class with an IEventActivity masking + + + + + Create an instance of the Activity class with IInvokeActivity masking + + + + + True if the Activity is of the specified activity type + + + + + Return an IMessageActivity mask if this is a message activity + + + + + Return an IContactRelationUpdateActivity mask if this is a contact relation update activity + + + + + Return an IConversationUpdateActivity mask if this is a conversation update activity + + + + + Return an ITypingActivity mask if this is a typing activity + + + + + Return an IEndOfConversationActivity mask if this is an end of conversation activity + + + + + Return an IEventActivity mask if this is an event activity + + + + + Return an IInvokeActivity mask if this is an invoke activity + + + + + Get StateClient appropriate for this activity + + credentials for bot to access state api + alternate serviceurl to use for state service + + + + + + Get StateClient appropriate for this activity + + + + alternate serviceurl to use for state service + + + + + + Check if the message has content + + Returns true if this message has any content to send + + + + Get mentions + + + + + + Is there a mention of Id in the Text Property + + ChannelAccount.Id + true if this id is mentioned in the text + + + + Is there a mention of Recipient.Id in the Text Property + + true if this id is mentioned in the text + + + + Remove recipient mention text from Text property + + new .Text property value + + + + Replace any mention text for given id from Text property + + id to match + new .Text property value + + + + Get channeldata as typed structure + + type to use + typed object or default(TypeT) + + + + Return the "major" portion of the activity + + normalized major portion of the activity, aka message/... will return "message" + + + + Initializes a new instance of the Activity class. + + + + + Initializes a new instance of the Activity class. + + + + + The type of the activity + [message|contactRelationUpdate|converationUpdate|typing|endOfConversation|event|invoke] + + + + + ID of this activity + + + + + UTC Time when message was sent (set by service) + + + + + Local time when message was sent (set by client, Ex: + 2016-09-23T13:07:49.4714686-07:00) + + + + + Service endpoint where operations concerning the activity may be + performed + + + + + ID of the channel where the activity was sent + + + + + Sender address + + + + + Conversation + + + + + (Outbound to bot only) Bot's address that received the message + + + + + Format of text fields [plain|markdown] Default:markdown + + + + + Hint for how to deal with multiple attachments: [list|carousel] + Default:list + + + + + Array of address added + + + + + Array of addresses removed + + + + + Conversations new topic name + + + + + True if the previous history of the channel is disclosed + + + + + The language code of the Text field + + + + + Content for the message + + + + + Text to display if the channel cannot render cards + + + + + Attachments + + + + + Collection of Entity objects, each of which contains metadata + about this activity. Each Entity object is typed. + + + + + Channel-specific payload + + + + + ContactAdded/Removed action + + + + + The original ID this message is a response to + + + + + Open-ended value + + + + + Name of the operation to invoke or the name of the event + + + + + Reference to another conversation or activity + + + + + Types of Activities + + + + + Message from a user -> bot or bot -> User + + + + + Bot added removed to contact list + + + + + This notification is sent when the conversation's properties change, for example the topic name, or when user joins or leaves the group. + + + + + a user is typing + + + + + Bounce a message off of the server without replying or changing it's state + + + + + End a conversation + + + + + NOTE: Trigger activity has been renamed to Event activity + + + + + Asynchronous external event + + + + + Synchronous request to invoke a command + + + + + Delete user data + + + + + Attachments operations. + + + + + Get the URI of an attachment view + + + default is "original" + uri + + + + Get the given attachmentid view as a stream + + attachmentid + view to get (default:original) + stream of attachment + + + + Initializes a new instance of the Attachments class. + + + Reference to the service client. + + + + + Gets a reference to the ConnectorClient + + + + + GetAttachmentInfo + + Get AttachmentInfo structure describing the attachment views + + attachment id + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + GetAttachment + + Get the named view as binary content + + attachment id + + + View id from attachmentInfo + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + Creates an instance of bot authenticator. + + The Microsoft app Id. + The Microsoft app password. + This constructor sets the to + and doesn't disable + the self issued tokens used by emulator. + + + + + Authenticates the incoming request and add the for each + activities to if the request is authenticated. + + The request that should be authenticated. + The activities extracted from request. + The cancellation token. + + + + + Generates response for the request. + + The request. + A response with status code unauthorized. + + + + Get a property from a BotData recorded retrieved using the REST API + + property name to change + property requested or default for type + + + + Set a property on a BotData record retrieved using the REST API + + property name to change + new data + + + + Remove a property from the BotData record + + property name to remove + + + + Initializes a new instance of the BotData class. + + + + + Initializes a new instance of the BotData class. + + + + + + + + + + + + + Creates a new attachment from . + + The instance of . + The generated attachment. + + + + Creates a new attachment from . + + The instance of . + The generated attachment. + + + + Creates a new attachment from . + + The instance of . + The generated attachment. + + + + Creates a new attachment from . + + The instance of . + The generated attachment. + + + + Creates a new attachment from . + + The instance of . + The generated attachment. + + + + Creates a new attachment from . + + The instance of . + The generated attachment. + + + + Creates a new attachment from . + + The instance of . + The generated attachment. + + + + Get the AppId from the Claims Identity + + + + + + + Get the AppPassword from the Claims Identity + + + + + + + Get the MicrosoftAppCredentials using claims in the claims identity + + + + + + + Extension methods for Attachments. + + + + + GetAttachmentInfo + + Get AttachmentInfo structure describing the attachment views + + The operations group for this extension method. + + + attachment id + + + + + GetAttachmentInfo + + Get AttachmentInfo structure describing the attachment views + + The operations group for this extension method. + + + attachment id + + + The cancellation token. + + + + + GetAttachment + + Get the named view as binary content + + The operations group for this extension method. + + + attachment id + + + View id from attachmentInfo + + + + + GetAttachment + + Get the named view as binary content + + The operations group for this extension method. + + + attachment id + + + View id from attachmentInfo + + + The cancellation token. + + + + + GetAttachmentStream + + Get the named view as binary stream + + The operations group for this extension method. + + + attachment id + + + View id from attachmentInfo + + + + + GetAttachmentStreamAsync + + Get the named view as binary content as a stream + + The operations group for this extension method. + + + attachment id + + + View id from attachmentInfo + + + The cancellation token. + + + + + The Bot Connector REST API allows your bot to send and receive + messages to channels configured in the + [Bot Framework Developer Portal](https://dev.botframework.com). The + Connector service uses industry-standard REST + and JSON over HTTPS. + + Client libraries for this REST API are available. See below for a + list. + + Many bots will use both the Bot Connector REST API and the associated + [Bot State REST API](/en-us/restapi/state). The + Bot State REST API allows a bot to store and retrieve state associated + with users and conversations. + + Authentication for both the Bot Connector and Bot State REST APIs is + accomplished with JWT Bearer tokens, and is + described in detail in the [Connector + Authentication](/en-us/restapi/authentication) document. + + # Client Libraries for the Bot Connector REST API + + * [Bot Builder for C#](/en-us/csharp/builder/sdkreference/) + * [Bot Builder for Node.js](/en-us/node/builder/overview/) + * Generate your own from the [Connector API Swagger + file](https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector/Swagger/ConnectorAPI.json) + + © 2016 Microsoft + + + + + The base URI of the service. + + + + + Gets or sets json serialization settings. + + + + + Gets or sets json deserialization settings. + + + + + Subscription credentials which uniquely identify client subscription. + + + + + Gets the IAttachments. + + + + + Gets the IConversations. + + + + + Initializes a new instance of the ConnectorClient class. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the ConnectorClient class. + + + Optional. The http client handler used to handle http transport. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the ConnectorClient class. + + + Optional. The base URI of the service. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the ConnectorClient class. + + + Optional. The base URI of the service. + + + Optional. The http client handler used to handle http transport. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the ConnectorClient class. + + + Required. Subscription credentials which uniquely identify client subscription. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the ConnectorClient class. + + + Required. Subscription credentials which uniquely identify client subscription. + + + Optional. The http client handler used to handle http transport. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the ConnectorClient class. + + + Optional. The base URI of the service. + + + Required. Subscription credentials which uniquely identify client subscription. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the ConnectorClient class. + + + Optional. The base URI of the service. + + + Required. Subscription credentials which uniquely identify client subscription. + + + Optional. The http client handler used to handle http transport. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes client properties. + + + + + Create a new instance of the ConnectorClient class + + Base URI for the Connector service + Optional. Your Microsoft app id. If null, this setting is read from settings["MicrosoftAppId"] + Optional. Your Microsoft app password. If null, this setting is read from settings["MicrosoftAppPassword"] + Optional. The delegating handlers to add to the http client pipeline. + + + + Create a new instance of the ConnectorClient class + + Base URI for the Connector service + Credentials for the Connector service + True, if JwtTokenRefresher should be included; False otherwise. + Optional. The delegating handlers to add to the http client pipeline. + + + + Conversations operations. + + + + + Initializes a new instance of the Conversations class. + + + Reference to the service client. + + + + + Gets a reference to the ConnectorClient + + + + + CreateConversation + + 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) + * Members array contining the members you want to have be 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() ... ) ; + + ``` + + Parameters to create the conversation from + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + SendToConversation + + This method allows you to send an activity to the end of a conversation. + + This is slightly different from ReplyToActivity(). + * SendToConverstion(conversationId) - will append the activity to the end + of the conversation according to the timestamp or semantics of the + channel. + * ReplyToActivity(conversationId,ActivityId) - adds the activity as a + reply to another activity, if the channel supports it. If the channel + does not support nested replies, ReplyToActivity falls back to + SendToConversation. + + Use ReplyToActivity when replying to a specific activity in the + conversation. + + Use SendToConversation in all other cases. + + Activity to send + + + Conversation ID + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + UpdateActivity + + Edit an existing activity. + + Some channels allow you to edit an existing activity to reflect the new + state of a bot conversation. + + For example, you can remove buttons after someone has clicked "Approve" + button. + + Conversation ID + + + activityId to update + + + replacement Activity + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + ReplyToActivity + + This method allows you to reply to an activity. + + This is slightly different from SendToConversation(). + * SendToConverstion(conversationId) - will append the activity to the end + of the conversation according to the timestamp or semantics of the + channel. + * ReplyToActivity(conversationId,ActivityId) - adds the activity as a + reply to another activity, if the channel supports it. If the channel + does not support nested replies, ReplyToActivity falls back to + SendToConversation. + + Use ReplyToActivity when replying to a specific activity in the + conversation. + + Use SendToConversation in all other cases. + + Conversation ID + + + activityId the reply is to (OPTIONAL) + + + Activity to send + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + DeleteActivity + + Delete an existing activity. + + Some channels allow you to delete an existing activity, and if successful + this method will remove the specified activity. + + Conversation ID + + + activityId to delete + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + GetConversationMembers + + Enumerate the members of a converstion. + + This REST API takes a ConversationId and returns an array of + ChannelAccount objects representing the members of the conversation. + + Conversation ID + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + GetActivityMembers + + Enumerate the members of an activity. + + This REST API takes a ConversationId and a ActivityId, returning an array + of ChannelAccount objects representing the members of the particular + activity in the conversation. + + Conversation ID + + + Activity ID + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + UploadAttachment + + Upload an attachment directly into a channel's blob storage. + + This is useful because it allows you to store data in a compliant store + when dealing with enterprises. + + The response is a ResourceResponse which contains an AttachmentId which is + suitable for using with the attachments API. + + Conversation ID + + + Attachment data + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + Extension methods for Conversations. + + + + + CreateConversation + + 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) + * Members array contining the members you want to have be 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() ... ) ; + + ``` + + The operations group for this extension method. + + + Parameters to create the conversation from + + + + + CreateConversation + + 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) + * Members array contining the members you want to have be 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() ... ) ; + + ``` + + The operations group for this extension method. + + + Parameters to create the conversation from + + + The cancellation token. + + + + + SendToConversation + + This method allows you to send an activity to the end of a conversation. + + This is slightly different from ReplyToActivity(). + * SendToConverstion(conversationId) - will append the activity to the end + of the conversation according to the timestamp or semantics of the + channel. + * ReplyToActivity(conversationId,ActivityId) - adds the activity as a + reply to another activity, if the channel supports it. If the channel + does not support nested replies, ReplyToActivity falls back to + SendToConversation. + + Use ReplyToActivity when replying to a specific activity in the + conversation. + + Use SendToConversation in all other cases. + + The operations group for this extension method. + + + Activity to send + + + Conversation ID + + + + + SendToConversation + + This method allows you to send an activity to the end of a conversation. + + This is slightly different from ReplyToActivity(). + * SendToConverstion(conversationId) - will append the activity to the end + of the conversation according to the timestamp or semantics of the + channel. + * ReplyToActivity(conversationId,ActivityId) - adds the activity as a + reply to another activity, if the channel supports it. If the channel + does not support nested replies, ReplyToActivity falls back to + SendToConversation. + + Use ReplyToActivity when replying to a specific activity in the + conversation. + + Use SendToConversation in all other cases. + + The operations group for this extension method. + + + Activity to send + + + Conversation ID + + + The cancellation token. + + + + + UpdateActivity + + Edit an existing activity. + + Some channels allow you to edit an existing activity to reflect the new + state of a bot conversation. + + For example, you can remove buttons after someone has clicked "Approve" + button. + + The operations group for this extension method. + + + Conversation ID + + + activityId to update + + + replacement Activity + + + + + UpdateActivity + + Edit an existing activity. + + Some channels allow you to edit an existing activity to reflect the new + state of a bot conversation. + + For example, you can remove buttons after someone has clicked "Approve" + button. + + The operations group for this extension method. + + + Conversation ID + + + activityId to update + + + replacement Activity + + + The cancellation token. + + + + + ReplyToActivity + + This method allows you to reply to an activity. + + This is slightly different from SendToConversation(). + * SendToConverstion(conversationId) - will append the activity to the end + of the conversation according to the timestamp or semantics of the + channel. + * ReplyToActivity(conversationId,ActivityId) - adds the activity as a + reply to another activity, if the channel supports it. If the channel + does not support nested replies, ReplyToActivity falls back to + SendToConversation. + + Use ReplyToActivity when replying to a specific activity in the + conversation. + + Use SendToConversation in all other cases. + + The operations group for this extension method. + + + Conversation ID + + + activityId the reply is to (OPTIONAL) + + + Activity to send + + + + + ReplyToActivity + + This method allows you to reply to an activity. + + This is slightly different from SendToConversation(). + * SendToConverstion(conversationId) - will append the activity to the end + of the conversation according to the timestamp or semantics of the + channel. + * ReplyToActivity(conversationId,ActivityId) - adds the activity as a + reply to another activity, if the channel supports it. If the channel + does not support nested replies, ReplyToActivity falls back to + SendToConversation. + + Use ReplyToActivity when replying to a specific activity in the + conversation. + + Use SendToConversation in all other cases. + + The operations group for this extension method. + + + Conversation ID + + + activityId the reply is to (OPTIONAL) + + + Activity to send + + + The cancellation token. + + + + + DeleteActivity + + Delete an existing activity. + + Some channels allow you to delete an existing activity, and if successful + this method will remove the specified activity. + + The operations group for this extension method. + + + Conversation ID + + + activityId to delete + + + + + DeleteActivity + + Delete an existing activity. + + Some channels allow you to delete an existing activity, and if successful + this method will remove the specified activity. + + The operations group for this extension method. + + + Conversation ID + + + activityId to delete + + + The cancellation token. + + + + + GetConversationMembers + + Enumerate the members of a converstion. + + This REST API takes a ConversationId and returns an array of + ChannelAccount objects representing the members of the conversation. + + The operations group for this extension method. + + + Conversation ID + + + + + GetConversationMembers + + Enumerate the members of a converstion. + + This REST API takes a ConversationId and returns an array of + ChannelAccount objects representing the members of the conversation. + + The operations group for this extension method. + + + Conversation ID + + + The cancellation token. + + + + + GetActivityMembers + + Enumerate the members of an activity. + + This REST API takes a ConversationId and a ActivityId, returning an array + of ChannelAccount objects representing the members of the particular + activity in the conversation. + + The operations group for this extension method. + + + Conversation ID + + + Activity ID + + + + + GetActivityMembers + + Enumerate the members of an activity. + + This REST API takes a ConversationId and a ActivityId, returning an array + of ChannelAccount objects representing the members of the particular + activity in the conversation. + + The operations group for this extension method. + + + Conversation ID + + + Activity ID + + + The cancellation token. + + + + + UploadAttachment + + Upload an attachment directly into a channel's blob storage. + + This is useful because it allows you to store data in a compliant store + when dealing with enterprises. + + The response is a ResourceResponse which contains an AttachmentId which is + suitable for using with the attachments API. + + The operations group for this extension method. + + + Conversation ID + + + Attachment data + + + + + UploadAttachment + + Upload an attachment directly into a channel's blob storage. + + This is useful because it allows you to store data in a compliant store + when dealing with enterprises. + + The response is a ResourceResponse which contains an AttachmentId which is + suitable for using with the attachments API. + + The operations group for this extension method. + + + Conversation ID + + + Attachment data + + + The cancellation token. + + + + + Create a new direct conversation between a bot and a user + + The operations group for this extension method. + Bot to create conversation from + User to create conversation with + (OPTIONAL) initial message to send to the new conversation + + + + Create a new direct conversation between a bot and a user + + The operations group for this extension method. + Bot to create conversation from + User to create conversation with + (OPTIONAL) initial message to send to the new conversation + The cancellation token. + + + + Create a new direct conversation between a bot and a user + + The operations group for this extension method. + Bot to create conversation from + User to create conversation with + (OPTIONAL) initial message to send to the new conversation + + + + Create a new direct conversation between a bot and a user + + The operations group for this extension method. + Bot to create conversation from + User to create conversation with + (OPTIONAL) initial message to send to the new conversation + The cancellation token + + + + Send an activity to a conversation + + + The operations group for this extension method. + + + Activity to send + + + + + Send an activity to a conversation + + + The operations group for this extension method. + + + Activity to send + + + The cancellation token. + + + + + Replyto an activity in an existing conversation + + + The operations group for this extension method. + + + Activity to send + + + + + Reply to an activity in an existing conversation + + + The operations group for this extension method. + + + Activity to send + + + The cancellation token. + + + + + Update an activity in an existing conversation + + + The operations group for this extension method. + + + Activity to update + + + + + Update an activity in an existing conversation + + + The operations group for this extension method. + + + Activity to update + + + The cancellation token. + + + + + Attachments operations. + + + + + GetAttachmentInfo + + Get AttachmentInfo structure describing the attachment views + + attachment id + + + The headers that will be added to request. + + + The cancellation token. + + + + + GetAttachment + + Get the named view as binary content + + attachment id + + + View id from attachmentInfo + + + The headers that will be added to request. + + + The cancellation token. + + + + + The Bot Connector REST API allows your bot to send and receive + messages to channels configured in the + [Bot Framework Developer Portal](https://dev.botframework.com). The + Connector service uses industry-standard REST + and JSON over HTTPS. + + Client libraries for this REST API are available. See below for a + list. + + Many bots will use both the Bot Connector REST API and the associated + [Bot State REST API](/en-us/restapi/state). The + Bot State REST API allows a bot to store and retrieve state associated + with users and conversations. + + Authentication for both the Bot Connector and Bot State REST APIs is + accomplished with JWT Bearer tokens, and is + described in detail in the [Connector + Authentication](/en-us/restapi/authentication) document. + + # Client Libraries for the Bot Connector REST API + + * [Bot Builder for C#](/en-us/csharp/builder/sdkreference/) + * [Bot Builder for Node.js](/en-us/node/builder/overview/) + * Generate your own from the [Connector API Swagger + file](https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector/Swagger/ConnectorAPI.json) + + © 2016 Microsoft + + + + + The base URI of the service. + + + + + Gets or sets json serialization settings. + + + + + Gets or sets json deserialization settings. + + + + + Subscription credentials which uniquely identify client + subscription. + + + + + Gets the IAttachments. + + + + + Gets the IConversations. + + + + + Conversations operations. + + + + + CreateConversation + + 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) + * Members array containing the members you want to have be 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() ... ) ; + + ``` + + Parameters to create the conversation from + + + The headers that will be added to request. + + + The cancellation token. + + + + + SendToConversation + + This method allows you to send an activity to the end of a + conversation. + + This is slightly different from ReplyToActivity(). + * SendToConverstion(conversationId) - will append the activity to + the end of the conversation according to the timestamp or + semantics of the channel. + * ReplyToActivity(conversationId,ActivityId) - adds the activity + as a reply to another activity, if the channel supports it. If + the channel does not support nested replies, ReplyToActivity + falls back to SendToConversation. + + Use ReplyToActivity when replying to a specific activity in the + conversation. + + Use SendToConversation in all other cases. + + Activity to send + + + Conversation ID + + + The headers that will be added to request. + + + The cancellation token. + + + + + UpdateActivity + + Edit an existing activity. + + Some channels allow you to edit an existing activity to reflect + the new state of a bot conversation. + + For example, you can remove buttons after someone has clicked + "Approve" button. + + Conversation ID + + + activityId to update + + + replacement Activity + + + The headers that will be added to request. + + + The cancellation token. + + + + + ReplyToActivity + + This method allows you to reply to an activity. + + This is slightly different from SendToConversation(). + * SendToConverstion(conversationId) - will append the activity to + the end of the conversation according to the timestamp or + semantics of the channel. + * ReplyToActivity(conversationId,ActivityId) - adds the activity + as a reply to another activity, if the channel supports it. If + the channel does not support nested replies, ReplyToActivity + falls back to SendToConversation. + + Use ReplyToActivity when replying to a specific activity in the + conversation. + + Use SendToConversation in all other cases. + + Conversation ID + + + activityId the reply is to (OPTIONAL) + + + Activity to send + + + The headers that will be added to request. + + + The cancellation token. + + + + + DeleteActivity + + Delete an existing activity. + + Some channels allow you to delete an existing activity, and if + successful this method will remove the specified activity. + + Conversation ID + + + activityId to delete + + + The headers that will be added to request. + + + The cancellation token. + + + + + GetConversationMembers + + Enumerate the members of a converstion. + + This REST API takes a ConversationId and returns an array of + ChannelAccount objects representing the members of the + conversation. + + Conversation ID + + + The headers that will be added to request. + + + The cancellation token. + + + + + GetActivityMembers + + Enumerate the members of an activity. + + This REST API takes a ConversationId and a ActivityId, returning + an array of ChannelAccount objects representing the members of + the particular activity in the conversation. + + Conversation ID + + + Activity ID + + + The headers that will be added to request. + + + The cancellation token. + + + + + UploadAttachment + + Upload an attachment directly into a channel's blob storage. + + This is useful because it allows you to store data in a compliant + store when dealing with enterprises. + + The response is a ResourceResponse which contains an AttachmentId + which is suitable for using with the attachments API. + + Conversation ID + + + Attachment data + + + The headers that will be added to request. + + + The cancellation token. + + + + + A thumbnail card (card with a single, small thumbnail image) + + + + + Initializes a new instance of the ThumbnailCard class. + + + + + Initializes a new instance of the ThumbnailCard class. + + + + + Title of the card + + + + + Subtitle of the card + + + + + Text for the card + + + + + Array of images for the card + + + + + Set of actions applicable to the current card + + + + + This action will be activated when user taps on the card itself + + + + + A Hero card (card with a single, large image) + + + + + Initializes a new instance of the HeroCard class. + + + + + Initializes a new instance of the HeroCard class. + + + + + Title of the card + + + + + Subtitle of the card + + + + + Text for the card + + + + + Array of images for the card + + + + + Set of actions applicable to the current card + + + + + This action will be activated when user taps on the card itself + + + + + A receipt card + + + + + Initializes a new instance of the ReceiptCard class. + + + + + Initializes a new instance of the ReceiptCard class. + + + + + Title of the card + + + + + Array of Receipt Items + + + + + Array of Fact Objects Array of key-value pairs. + + + + + This action will be activated when user taps on the card + + + + + Total amount of money paid (or should be paid) + + + + + Total amount of TAX paid(or should be paid) + + + + + Total amount of VAT paid(or should be paid) + + + + + Set of actions applicable to the current card + + + + + A card representing a request to sign in + + + + + Initializes a new instance of the SigninCard class. + + + + + Initializes a new instance of the SigninCard class. + + + + + Text for signin request + + + + + Action to use to perform signin + + + + + Creates a + + The + The signin button label. + The sigin url. + The created sigin card. + + + + An animation card (Ex: gif or short video clip) + + + + + Initializes a new instance of the AnimationCard class. + + + + + Initializes a new instance of the AnimationCard class. + + + + + Title of the card + + + + + Subtitle of the card + + + + + Text of the card + + + + + Thumbnail placeholder + + + + + Array of media Url objects + + + + + Set of actions applicable to the current card + + + + + Is it OK for this content to be shareable with others + (default:true) + + + + + Should the client loop playback at end of content (default:true) + + + + + Should the client automatically start playback of video in this + card (default:true) + + + + + A audio card + + + + + Initializes a new instance of the AudioCard class. + + + + + Initializes a new instance of the AudioCard class. + + + + + Title of the card + + + + + Subtitle of the card + + + + + Text of the card + + + + + Thumbnail placeholder + + + + + Array of media Url objects + + + + + Set of actions applicable to the current card + + + + + Is it OK for this content to be shareable with others + (default:true) + + + + + Should the client loop playback at end of content (default:true) + + + + + Should the client automatically start playback of video in this + card (default:true) + + + + + Aspect ratio of thumbnail/media placeholder, allowed values are + "16x9" and "9x16" + + + + + A video card + + + + + Initializes a new instance of the VideoCard class. + + + + + Initializes a new instance of the VideoCard class. + + + + + Aspect ratio (16:9)(4:3) + + + + + Title of the card + + + + + Subtitle of the card + + + + + Text of the card + + + + + Thumbnail placeholder + + + + + Array of media Url objects + + + + + Set of actions applicable to the current card + + + + + Is it OK for this content to be shareable with others + (default:true) + + + + + Should the client loop playback at end of content (default:true) + + + + + Should the client automatically start playback of video in this + card (default:true) + + + + + An attachment within an activity + + + + + Initializes a new instance of the Attachment class. + + + + + Initializes a new instance of the Attachment class. + + + + + mimetype/Contenttype for the file + + + + + Content Url + + + + + Embedded content + + + + + (OPTIONAL) The name of the attachment + + + + + (OPTIONAL) Thumbnail associated with attachment + + + + + Attachment data + + + + + Initializes a new instance of the AttachmentData class. + + + + + Initializes a new instance of the AttachmentData class. + + + + + content type of the attachmnet + + + + + Name of the attachment + + + + + original content + + + + + Thumbnail + + + + + Metdata for an attachment + + + + + Initializes a new instance of the AttachmentInfo class. + + + + + Initializes a new instance of the AttachmentInfo class. + + + + + Name of the attachment + + + + + ContentType of the attachment + + + + + attachment views + + + + + Attachment View name and size + + + + + Initializes a new instance of the AttachmentView class. + + + + + Initializes a new instance of the AttachmentView class. + + + + + content type of the attachmnet + + + + + Name of the attachment + + + + + An action on a card + + + + + Initializes a new instance of the CardAction class. + + + + + Initializes a new instance of the CardAction class. + + + + + Defines the type of action implemented by this button. + + + + + Text description which appear on the button. + + + + + URL Picture which will appear on the button, next to text label. + + + + + Supplementary parameter for action. Content of this property + depends on the ActionType + + + + + An image on a card + + + + + Initializes a new instance of the CardImage class. + + + + + Initializes a new instance of the CardImage class. + + + + + URL Thumbnail image for major content property. + + + + + Image description intended for screen readers + + + + + Action assigned to specific Attachment.E.g.navigate to specific + URL or play/open media content + + + + + Channel account information needed to route a message + + + + + Initializes a new instance of the ChannelAccount class. + + + + + Initializes a new instance of the ChannelAccount class. + + + + + Channel id for the user or bot on this channel (Example: + joe@smith.com, or @joesmith or 123456) + + + + + Display friendly name + + + + + Channel account information for a conversation + + + + + Initializes a new instance of the ConversationAccount class. + + + + + Initializes a new instance of the ConversationAccount class. + + + + + Is this a reference to a group + + + + + Channel id for the user or bot on this channel (Example: + joe@smith.com, or @joesmith or 123456) + + + + + Display friendly name + + + + + Parameters for creating a new conversation + + + + + Initializes a new instance of the ConversationParameters class. + + + + + Initializes a new instance of the ConversationParameters class. + + + + + IsGroup + + + + + The bot address for this conversation + + + + + Members to add to the conversation + + + + + (Optional) Topic of the conversation (if supported by the channel) + + + + + (Optional) When creating a new conversation, use this activity as + the intial message to the conversation + + + + + Channel specific payload for creating the conversation + + + + + An object relating to a particular point in a conversation + + + + + Initializes a new instance of the ConversationReference class. + + + + + Initializes a new instance of the ConversationReference class. + + + + + (Optional) ID of the activity to refer to + + + + + (Optional) User participating in this conversation + + + + + Bot participating in this conversation + + + + + Conversation reference + + + + + Channel ID + + + + + Service endpoint where operations concerning the referenced + conversation may be performed + + + + + A response containing a resource + + + + + Initializes a new instance of the ConversationResourceResponse + class. + + + + + Initializes a new instance of the ConversationResourceResponse + class. + + + + + ID of the Activity (if sent) + + + + + Service endpoint where operations concerning the conversation may + be performed + + + + + Id of the resource + + + + + Object of schema.org types + + + + + Initializes a new instance of the Entity class. + + + + + Initializes a new instance of the Entity class. + + + + + Entity Type (typically from schema.org types) + + + + + Retrieve internal payload. + + + + + + + Set internal payload. + + + + + + + Object representing error information + + + + + Initializes a new instance of the Error class. + + + + + Initializes a new instance of the Error class. + + + + + Error code + + + + + Error message + + + + + An HTTP API response + + + + + Initializes a new instance of the ErrorResponse class. + + + + + Initializes a new instance of the ErrorResponse class. + + + + + Error message + + + + + Set of key-value pairs. Advantage of this section is that key and + value properties will be + rendered with default style information with some + delimiter between them. So there is no need for developer to specify + style information. + + + + + Initializes a new instance of the Fact class. + + + + + Initializes a new instance of the Fact class. + + + + + The key for this Fact + + + + + The value for this Fact + + + + + GeoCoordinates (entity type: "https://schema.org/GeoCoordinates") + + + + + Initializes a new instance of the GeoCoordinates class. + + + + + Initializes a new instance of the GeoCoordinates class. + + + + + Elevation of the location [WGS + 84](https://en.wikipedia.org/wiki/World_Geodetic_System) + + + + + Latitude of the location [WGS + 84](https://en.wikipedia.org/wiki/World_Geodetic_System) + + + + + Longitude of the location [WGS + 84](https://en.wikipedia.org/wiki/World_Geodetic_System) + + + + + The type of the thing + + + + + The name of the thing + + + + + MediaUrl data + + + + + Initializes a new instance of the MediaUrl class. + + + + + Initializes a new instance of the MediaUrl class. + + + + + Url for the media + + + + + Optional profile hint to the client to differentiate multiple + MediaUrl objects from each other + + + + + Place (entity type: "https://schema.org/Place") + + + + + Initializes a new instance of the Place class. + + + + + Initializes a new instance of the Place class. + + + + + Address of the place (may be `string` or complex object of type + `PostalAddress`) + + + + + Geo coordinates of the place (may be complex object of type + `GeoCoordinates` or `GeoShape`) + + + + + Map to the place (may be `string` (URL) or complex object of type + `Map`) + + + + + The type of the thing + + + + + The name of the thing + + + + + An item on a receipt card + + + + + Initializes a new instance of the ReceiptItem class. + + + + + Initializes a new instance of the ReceiptItem class. + + + + + Title of the Card + + + + + Subtitle appears just below Title field, differs from Title in + font styling only + + + + + Text field appears just below subtitle, differs from Subtitle in + font styling only + + + + + Image + + + + + Amount with currency + + + + + Number of items of given kind + + + + + This action will be activated when user taps on the Item bubble. + + + + + A response containing a resource ID + + + + + Initializes a new instance of the ResourceResponse class. + + + + + Initializes a new instance of the ResourceResponse class. + + + + + Id of the resource + + + + + Object describing a media thumbnail + + + + + Initializes a new instance of the ThumbnailUrl class. + + + + + Initializes a new instance of the ThumbnailUrl class. + + + + + url pointing to an thumbnail to use for media content + + + + + Alt text to display for screen readers on the thumbnail image + + + + + Bot added to user contacts + + + + + Bot removed from user contacts + + + + + Validate AppId + + + true if it is a valid AppId for the controller + + + + Get the app password for a given bot appId, if it is not a valid appId, return Null + + bot appid + password or null for invalid appid + + + + Checks if bot authentication is disabled. + + true if bot authentication is disabled. + + + + Static credential provider which has the appid and password static + + + + + Credential provider which uses to lookup appId and password + + + + + Error codes to communicate when throwing an APIException + + + + + Other error, not specified + + + + + Bad argument + + + + + Error parsing request + + + + + Mandatory property was not specified + + + + + Message exceeded size limits + + + + + add Bearer authorization token for making API calls + + The http client + (default)Setting["microsoftAppId"] + (default)Setting["microsoftAppPassword"] + HttpClient with Bearer Authorization header + + + + Shared properties for all activities + + + + + Activity type + + + + + Id for the activity + + + + + ServiceUrl + + + + + UTC Time when message was sent + + + + + Client Time when message was sent Ex: 2016-09-23T13:07:49.4714686-07:00 + + + + + Channel this activity is associated with + + + + + Sender address data + + + + + Address for the conversation that this activity is associated with + + + + + Address that received the message + + + + + The original id this message is a response to + + + + + Channel specific payload + + + Some channels will provide channel specific data. + + For a message originating in the channel it might provide the original native schema object for the channel. + + For a message coming into the channel it might accept a payload allowing you to create a "native" response for the channel. + + Example: + * Email - The Email Channel will put the original Email metadata into the ChannelData object for outgoing messages, and will accep + on incoming message a Subject property, and a HtmlBody which can contain Html. + + The channel data essentially allows a bot to have access to native functionality on a per channel basis. + + + + + Return IMessageActivity if this is a message activity, null otherwise + + + + + Return IContactRelationUpdateActivity if this is a contactRelationUpdate activity, null otherwise + + + + + Return IConversationUpdateActivity if this is a conversationUpdate activity, null otherwise + + + + + Return ITypingActivity if this is a typing activity, null otherwise + + + + + Return IEndOfConversationActivity if this is an end-of-conversation activity, null otherwise + + + + + Returns IEventActivity if this is an event activity, null otherwise + + + + + Returns IInvokeActivity if this is an invoke activity, null otherwise + + + + + A user has added a bot to their contact list, removed the bot from their contact list, or otherwise changed the relationship between user and bot + + + + + add|remove + + + + + The referenced conversation has been updated + + + + + Members added to the conversation + + + + + Members removed from the conversation + + + + + The conversation's updated topic name + + + + + True if prior history of the channel is disclosed + + + + + Conversation is ending, or a request to end the conversation + + + + + Asynchronous external event + + + + + Name of the event + + + + + Open-ended value + + + + + Reference to another conversation or activity + + + + + NOTE: Trigger activity has been renamed to Event activity + + + + + Synchronous request to invoke an operation + + + + + Name of the operation to invoke + + + + + Open-ended value + + + + + Reference to another conversation or activity + + + + + A message in a conversation + + + + + The language code of the Text field + + + See https://msdn.microsoft.com/en-us/library/hh456380.aspx for a list of valid language codes + + + + + Content for the message + + + + + Text to display if the channel cannot render cards + + + + + Format of text fields [plain|markdown] Default:markdown + + + + + Hint for how to deal with multiple attachments: [list|carousel] Default:list + + + + + Attachments + + + + + Collection of Entity objects, each of which contains metadata about this activity. Each Entity object is typed. + + + + + True if this activity has text, attachments, or channelData + + + + + Get channeldata as typed structure + + type to use + typed object or default(TypeT) + + + + Get mentions + + + + + The From address is typing + + + + + Configuration for JWT tokens + + + + + TO CHANNEL FROM BOT: Login URL + + + + + TO CHANNEL FROM BOT: OAuth scope to request + + + + + TO BOT FROM CHANNEL: OpenID metadata document for tokens coming from MSA + + + + + TO BOT FROM CHANNEL: Token validation parameters when connecting to a bot + + + + + TO BOT FROM EMULATOR: OpenID metadata document for tokens coming from MSA + + + + + TO BOT FROM EMULATOR: Token validation parameters when connecting to a channel + + + + + Shared of OpenIdConnect configuration managers (one per metadata URL) + + + + + Token validation parameters for this instance + + + + + OpenIdConnect configuration manager for this instances + + + + + + + + + Initializes a new instance of the Entity class. + + + + + The key for Microsoft app Id. + + + + + The key for Microsoft app Password. + + + + + Adds the host of service url to trusted hosts. + + The service url + The expiration time after which this service url is not trusted anymore + If expiration time is not provided, the expiration time will DateTime.UtcNow.AddDays(1). + + + + Checks if the service url is for a trusted host or not. + + The service url + True if the host of the service url is trusted; False otherwise. + + + + Apply the credentials to the HTTP request. + + The HTTP request.Cancellation token. + + + + BotState operations. + + + + + Initializes a new instance of the BotState class. + + + Reference to the service client. + + + + + Gets a reference to the StateClient + + + + + GetUserData + + Get a bots data for the user across all conversations + + channelId + + + id for the user on the channel + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + SetUserData + + Update the bot's data for a user + + channelId + + + id for the user on the channel + + + the new botdata + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + DeleteStateForUser + + Delete all data for a user in a channel (UserData and + PrivateConversationData) + + channelId + + + id for the user on the channel + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + GetConversationData + + get the bots data for all users in a conversation + + the channelId + + + The id for the conversation on the channel + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + SetConversationData + + Update the bot's data for all users in a conversation + + channelId + + + The id for the conversation on the channel + + + the new botdata + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + GetPrivateConversationData + + get bot's data for a single user in a conversation + + channelId + + + The id for the conversation on the channel + + + id for the user on the channel + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + SetPrivateConversationData + + Update the bot's data for a single user in a conversation + + channelId + + + The id for the conversation on the channel + + + id for the user on the channel + + + the new botdata + + + Headers that will be added to request. + + + The cancellation token. + + + A response object containing the response body and response headers. + + + + + Extension methods for BotState. + + + + + GetUserData + + Get a bots data for the user across all conversations + + The operations group for this extension method. + + + channelId + + + id for the user on the channel + + + + + GetUserData + + Get a bots data for the user across all conversations + + The operations group for this extension method. + + + channelId + + + id for the user on the channel + + + The cancellation token. + + + + + SetUserData + + Update the bot's data for a user + + The operations group for this extension method. + + + channelId + + + id for the user on the channel + + + the new botdata + + + + + SetUserData + + Update the bot's data for a user + + The operations group for this extension method. + + + channelId + + + id for the user on the channel + + + the new botdata + + + The cancellation token. + + + + + DeleteStateForUser + + Delete all data for a user in a channel (UserData and + PrivateConversationData) + + The operations group for this extension method. + + + channelId + + + id for the user on the channel + + + + + DeleteStateForUser + + Delete all data for a user in a channel (UserData and + PrivateConversationData) + + The operations group for this extension method. + + + channelId + + + id for the user on the channel + + + The cancellation token. + + + + + GetConversationData + + get the bots data for all users in a conversation + + The operations group for this extension method. + + + the channelId + + + The id for the conversation on the channel + + + + + GetConversationData + + get the bots data for all users in a conversation + + The operations group for this extension method. + + + the channelId + + + The id for the conversation on the channel + + + The cancellation token. + + + + + SetConversationData + + Update the bot's data for all users in a conversation + + The operations group for this extension method. + + + channelId + + + The id for the conversation on the channel + + + the new botdata + + + + + SetConversationData + + Update the bot's data for all users in a conversation + + The operations group for this extension method. + + + channelId + + + The id for the conversation on the channel + + + the new botdata + + + The cancellation token. + + + + + GetPrivateConversationData + + get bot's data for a single user in a conversation + + The operations group for this extension method. + + + channelId + + + The id for the conversation on the channel + + + id for the user on the channel + + + + + GetPrivateConversationData + + get bot's data for a single user in a conversation + + The operations group for this extension method. + + + channelId + + + The id for the conversation on the channel + + + id for the user on the channel + + + The cancellation token. + + + + + SetPrivateConversationData + + Update the bot's data for a single user in a conversation + + The operations group for this extension method. + + + channelId + + + The id for the conversation on the channel + + + id for the user on the channel + + + the new botdata + + + + + SetPrivateConversationData + + Update the bot's data for a single user in a conversation + + The operations group for this extension method. + + + channelId + + + The id for the conversation on the channel + + + id for the user on the channel + + + the new botdata + + + The cancellation token. + + + + + BotState operations. + + + + + GetUserData + + Get a bots data for the user across all conversations + + channelId + + + id for the user on the channel + + + The headers that will be added to request. + + + The cancellation token. + + + + + SetUserData + + Update the bot's data for a user + + channelId + + + id for the user on the channel + + + the new botdata + + + The headers that will be added to request. + + + The cancellation token. + + + + + DeleteStateForUser + + Delete all data for a user in a channel (UserData and + PrivateConversationData) + + channelId + + + id for the user on the channel + + + The headers that will be added to request. + + + The cancellation token. + + + + + GetConversationData + + get the bots data for all users in a conversation + + the channelId + + + The id for the conversation on the channel + + + The headers that will be added to request. + + + The cancellation token. + + + + + SetConversationData + + Update the bot's data for all users in a conversation + + channelId + + + The id for the conversation on the channel + + + the new botdata + + + The headers that will be added to request. + + + The cancellation token. + + + + + GetPrivateConversationData + + get bot's data for a single user in a conversation + + channelId + + + The id for the conversation on the channel + + + id for the user on the channel + + + The headers that will be added to request. + + + The cancellation token. + + + + + SetPrivateConversationData + + Update the bot's data for a single user in a conversation + + channelId + + + The id for the conversation on the channel + + + id for the user on the channel + + + the new botdata + + + The headers that will be added to request. + + + The cancellation token. + + + + + The Bot State REST API allows your bot to store and retrieve state + associated with conversations conducted through + the [Bot Connector REST API](/en-us/restapi/connector). The Bot State + REST API uses REST and HTTPS to send and receive + encoded content that your bot controls. + + Client libraries for this REST API are available. See below for a + list. + + Your bot may store data for a user, a conversation, or a single user + within a conversation (called "private" data). + Each payload may be up to 32 kilobytes in size. The data may be + removed by the bot or upon a user's request, e.g. + if the user requests the channel to inform the bot (and therefore, the + Bot Framework) to delete the user's data. + + The Bot State REST API is only useful in conjunction with the Bot + Connector REST API. + + Authentication for both the Bot State and Bot Connector REST APIs is + accomplished with JWT Bearer tokens, and is + described in detail in the [Connector + Authentication](/en-us/restapi/authentication) document. + + # Client Libraries for the Bot State REST API + + * [Bot Builder for C#](/en-us/csharp/builder/sdkreference/) + * [Bot Builder for Node.js](/en-us/node/builder/overview/) + * Generate your own from the [State API Swagger + file](https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector/Swagger/StateAPI.json) + + © 2016 Microsoft + + + + + The base URI of the service. + + + + + Gets or sets json serialization settings. + + + + + Gets or sets json deserialization settings. + + + + + Subscription credentials which uniquely identify client + subscription. + + + + + Gets the IBotState. + + + + + Initializes a new instance of the APIResponse class. + + + + + Initializes a new instance of the APIResponse class. + + + + + + + + + The Bot State REST API allows your bot to store and retrieve state + associated with conversations conducted through + the [Bot Connector REST API](/en-us/restapi/connector). The Bot State + REST API uses REST and HTTPS to send and receive + encoded content that your bot controls. + + Client libraries for this REST API are available. See below for a + list. + + Your bot may store data for a user, a conversation, or a single user + within a conversation (called "private" data). + Each payload may be up to 32 kilobytes in size. The data may be + removed by the bot or upon a user's request, e.g. + if the user requests the channel to inform the bot (and therefore, the + Bot Framework) to delete the user's data. + + The Bot State REST API is only useful in conjunction with the Bot + Connector REST API. + + Authentication for both the Bot State and Bot Connector REST APIs is + accomplished with JWT Bearer tokens, and is + described in detail in the [Connector + Authentication](/en-us/restapi/authentication) document. + + # Client Libraries for the Bot State REST API + + * [Bot Builder for C#](/en-us/csharp/builder/sdkreference/) + * [Bot Builder for Node.js](/en-us/node/builder/overview/) + * Generate your own from the [State API Swagger + file](https://raw.githubusercontent.com/Microsoft/BotBuilder/master/CSharp/Library/Microsoft.Bot.Connector/Swagger/StateAPI.json) + + © 2016 Microsoft + + + + + The base URI of the service. + + + + + Gets or sets json serialization settings. + + + + + Gets or sets json deserialization settings. + + + + + Subscription credentials which uniquely identify client subscription. + + + + + Gets the IBotState. + + + + + Initializes a new instance of the StateClient class. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the StateClient class. + + + Optional. The http client handler used to handle http transport. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the StateClient class. + + + Optional. The base URI of the service. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the StateClient class. + + + Optional. The base URI of the service. + + + Optional. The http client handler used to handle http transport. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the StateClient class. + + + Required. Subscription credentials which uniquely identify client subscription. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the StateClient class. + + + Required. Subscription credentials which uniquely identify client subscription. + + + Optional. The http client handler used to handle http transport. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the StateClient class. + + + Optional. The base URI of the service. + + + Required. Subscription credentials which uniquely identify client subscription. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes a new instance of the StateClient class. + + + Optional. The base URI of the service. + + + Required. Subscription credentials which uniquely identify client subscription. + + + Optional. The http client handler used to handle http transport. + + + Optional. The delegating handlers to add to the http client pipeline. + + + + + Initializes client properties. + + + + + Create a new instance of the StateClient class + + Base URI for the State service + Optional. Your Microsoft app id. If null, this setting is read from settings["MicrosoftAppId"] + Optional. Your Microsoft app password. If null, this setting is read from settings["MicrosoftAppPassword"] + Optional. The delegating handlers to add to the http client pipeline. + + + + Create a new instance of the StateClient class + + Base URI for the State service + Credentials for the Connector service + True, if JwtTokenRefresher should be included; False otherwise. + Optional. The delegating handlers to add to the http client pipeline. + + + + Create a new instance of the StateClient class + + This constructor will use https://state.botframework.com as the baseUri + Credentials for the Connector service + True, if JwtTokenRefresher should be included; False otherwise. + Optional. The delegating handlers to add to the http client pipeline. + + + + Default- interpret text fields as markdown + + + + + Plain text (do not interpret as anything) + + + + + B, I, S, U, A NOTE: Only supported on Skype for now + + + + diff --git a/CSharp/Tests/Microsoft.Bot.Builder.Tests/FormTests.cs b/CSharp/Tests/Microsoft.Bot.Builder.Tests/FormTests.cs index 4705b5f9c7..656ff84aee 100644 --- a/CSharp/Tests/Microsoft.Bot.Builder.Tests/FormTests.cs +++ b/CSharp/Tests/Microsoft.Bot.Builder.Tests/FormTests.cs @@ -318,6 +318,54 @@ await VerifyFormScript(pathScript, [TestMethod] [DeploymentItem(@"Scripts\SimpleForm-Prompter.script")] public async Task SimpleForm_Prompter_Script() + { + var pathScript = TestFiles.DeploymentItemPathsForCaller(TestContext, this.GetType()).Single(); + await VerifyFormScript(pathScript, + "en-us", + () => new FormBuilder() + .Prompter(async (context, prompt, state, field) => + { + if (field != null) + { + prompt.Prompt = field.Name + ": " + prompt.Prompt; + } + var preamble = context.MakeMessage(); + var promptMessage = context.MakeMessage(); + if (prompt.GenerateMessages(preamble, promptMessage)) + { + await context.PostAsync(preamble); + } + await context.PostAsync(promptMessage); + return prompt; + }) + .AddRemainingFields() + .Confirm(@"**Results** +* Text: {Text} +* Integer: {Integer} +* Float: {Float} +* SomeChoices: {SomeChoices} +* Date: {Date} +Is this what you wanted? {||}") + .Build(), + FormOptions.None, new SimpleForm(), Array.Empty(), + "Hi", + "some text here", + "99", + "1.5", + "more than one", + "foo", + "two", + "1/1/2016", + "no", + "text", + "abc", + "yes" + ); + } + + [TestMethod] + [DeploymentItem(@"Scripts\SimpleForm-Preamble.script")] + public async Task SimpleForm_Preamble_Script() { var pathScript = TestFiles.DeploymentItemPathsForCaller(TestContext, this.GetType()).Single(); await VerifyFormScript(pathScript, diff --git a/CSharp/Tests/Microsoft.Bot.Builder.Tests/Microsoft.Bot.Builder.Tests.csproj b/CSharp/Tests/Microsoft.Bot.Builder.Tests/Microsoft.Bot.Builder.Tests.csproj index 47062a9749..8710181dde 100644 --- a/CSharp/Tests/Microsoft.Bot.Builder.Tests/Microsoft.Bot.Builder.Tests.csproj +++ b/CSharp/Tests/Microsoft.Bot.Builder.Tests/Microsoft.Bot.Builder.Tests.csproj @@ -192,6 +192,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/CSharp/Tests/Microsoft.Bot.Builder.Tests/Scripts/SimpleForm-Preamble.script b/CSharp/Tests/Microsoft.Bot.Builder.Tests/Scripts/SimpleForm-Preamble.script new file mode 100644 index 0000000000..e59b01f343 --- /dev/null +++ b/CSharp/Tests/Microsoft.Bot.Builder.Tests/Scripts/SimpleForm-Preamble.script @@ -0,0 +1,53 @@ +en-us +{"Date":"0001-01-01T00:00:00","Float":null,"Integer":0,"SomeChoices":0,"Text":null} +[] +FromUser:"Hi" +1 +ToUserText:"Please enter text " +State:{"Date":"0001-01-01T00:00:00","Float":null,"Integer":0,"SomeChoices":0,"Text":null} +FromUser:"some text here" +1 +ToUserText:"Please enter a number for integer (current choice: 0)" +State:{"Date":"0001-01-01T00:00:00","Float":null,"Integer":0,"SomeChoices":0,"Text":"some text here"} +FromUser:"99" +1 +ToUserText:"Please enter a number for float " +State:{"Date":"0001-01-01T00:00:00","Float":null,"Integer":99,"SomeChoices":0,"Text":"some text here"} +FromUser:"1.5" +1 +ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"Please select a some choices ","images":null,"buttons":[{"type":"imBack","title":"One","image":null,"value":"One"},{"type":"imBack","title":"Two","image":null,"value":"Two"},{"type":"imBack","title":"Three","image":null,"value":"Three"},{"type":"imBack","title":"Four","image":null,"value":"Four"}],"tap":null},"name":null,"thumbnailUrl":null}] +State:{"Date":"0001-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":0,"Text":"some text here"} +FromUser:"more than one" +1 +ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"By \"more than one\" some choices did you mean ","images":null,"buttons":[{"type":"imBack","title":"Three","image":null,"value":"Three"},{"type":"imBack","title":"Two","image":null,"value":"Two"}],"tap":null},"name":null,"thumbnailUrl":null}] +State:{"Date":"0001-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":0,"Text":"some text here"} +FromUser:"foo" +1 +ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"Choices ","images":null,"buttons":[{"type":"imBack","title":"Three","image":null,"value":"Three"},{"type":"imBack","title":"Two","image":null,"value":"Two"}],"tap":null},"name":null,"thumbnailUrl":null}] +State:{"Date":"0001-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":0,"Text":"some text here"} +FromUser:"two" +1 +ToUserText:"Please enter a date and time for date " +State:{"Date":"0001-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":2,"Text":"some text here"} +FromUser:"1/1/2016" +2 +ToUserText:"**Results**\r\n* Text: some text here\r\n* Integer: 99\r\n* Float: 1.5\r\n* SomeChoices: Two\r\n* Date: 1/1/2016 12:00:00 AM" +ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"Is this what you wanted? ","images":null,"buttons":[{"type":"imBack","title":"Yes","image":null,"value":"Yes"},{"type":"imBack","title":"No","image":null,"value":"No"}],"tap":null},"name":null,"thumbnailUrl":null}] +State:{"Date":"2016-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":2,"Text":"some text here"} +FromUser:"no" +1 +ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"What do you want to change? ","images":null,"buttons":[{"type":"imBack","title":"Text(some text here)","image":null,"value":"Text"},{"type":"imBack","title":"Integer(99)","image":null,"value":"Integer"},{"type":"imBack","title":"Float(1.5)","image":null,"value":"Float"},{"type":"imBack","title":"Some Choices(Two)","image":null,"value":"Some Choices"},{"type":"imBack","title":"Date(1/1/2016 12:00:00 AM)","image":null,"value":"Date"},{"type":"imBack","title":"No Preference","image":null,"value":"No Preference"}],"tap":null},"name":null,"thumbnailUrl":null}] +State:{"Date":"2016-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":2,"Text":"some text here"} +FromUser:"text" +1 +ToUserText:"Please enter text (current choice: some text here)" +State:{"Date":"2016-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":2,"Text":"some text here"} +FromUser:"abc" +2 +ToUserText:"**Results**\r\n* Text: abc\r\n* Integer: 99\r\n* Float: 1.5\r\n* SomeChoices: Two\r\n* Date: 1/1/2016 12:00:00 AM" +ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"Is this what you wanted? ","images":null,"buttons":[{"type":"imBack","title":"Yes","image":null,"value":"Yes"},{"type":"imBack","title":"No","image":null,"value":"No"}],"tap":null},"name":null,"thumbnailUrl":null}] +State:{"Date":"2016-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":2,"Text":"abc"} +FromUser:"yes" +0 +State:{"Date":"2016-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":2,"Text":"abc"} +Result: {"Text":"abc","Integer":99,"Float":1.5,"SomeChoices":2,"Date":"2016-01-01T00:00:00"} diff --git a/CSharp/Tests/Microsoft.Bot.Builder.Tests/Scripts/SimpleForm-Prompter.script b/CSharp/Tests/Microsoft.Bot.Builder.Tests/Scripts/SimpleForm-Prompter.script index e59b01f343..b21e727324 100644 --- a/CSharp/Tests/Microsoft.Bot.Builder.Tests/Scripts/SimpleForm-Prompter.script +++ b/CSharp/Tests/Microsoft.Bot.Builder.Tests/Scripts/SimpleForm-Prompter.script @@ -3,48 +3,48 @@ en-us [] FromUser:"Hi" 1 -ToUserText:"Please enter text " +ToUserText:"Text: Please enter text " State:{"Date":"0001-01-01T00:00:00","Float":null,"Integer":0,"SomeChoices":0,"Text":null} FromUser:"some text here" 1 -ToUserText:"Please enter a number for integer (current choice: 0)" +ToUserText:"Integer: Please enter a number for integer (current choice: 0)" State:{"Date":"0001-01-01T00:00:00","Float":null,"Integer":0,"SomeChoices":0,"Text":"some text here"} FromUser:"99" 1 -ToUserText:"Please enter a number for float " +ToUserText:"Float: Please enter a number for float " State:{"Date":"0001-01-01T00:00:00","Float":null,"Integer":99,"SomeChoices":0,"Text":"some text here"} FromUser:"1.5" 1 -ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"Please select a some choices ","images":null,"buttons":[{"type":"imBack","title":"One","image":null,"value":"One"},{"type":"imBack","title":"Two","image":null,"value":"Two"},{"type":"imBack","title":"Three","image":null,"value":"Three"},{"type":"imBack","title":"Four","image":null,"value":"Four"}],"tap":null},"name":null,"thumbnailUrl":null}] +ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"SomeChoices: Please select a some choices ","images":null,"buttons":[{"type":"imBack","title":"One","image":null,"value":"One"},{"type":"imBack","title":"Two","image":null,"value":"Two"},{"type":"imBack","title":"Three","image":null,"value":"Three"},{"type":"imBack","title":"Four","image":null,"value":"Four"}],"tap":null},"name":null,"thumbnailUrl":null}] State:{"Date":"0001-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":0,"Text":"some text here"} FromUser:"more than one" 1 -ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"By \"more than one\" some choices did you mean ","images":null,"buttons":[{"type":"imBack","title":"Three","image":null,"value":"Three"},{"type":"imBack","title":"Two","image":null,"value":"Two"}],"tap":null},"name":null,"thumbnailUrl":null}] +ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"SomeChoices: By \"more than one\" some choices did you mean ","images":null,"buttons":[{"type":"imBack","title":"Three","image":null,"value":"Three"},{"type":"imBack","title":"Two","image":null,"value":"Two"}],"tap":null},"name":null,"thumbnailUrl":null}] State:{"Date":"0001-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":0,"Text":"some text here"} FromUser:"foo" 1 -ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"Choices ","images":null,"buttons":[{"type":"imBack","title":"Three","image":null,"value":"Three"},{"type":"imBack","title":"Two","image":null,"value":"Two"}],"tap":null},"name":null,"thumbnailUrl":null}] +ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"SomeChoices: Choices ","images":null,"buttons":[{"type":"imBack","title":"Three","image":null,"value":"Three"},{"type":"imBack","title":"Two","image":null,"value":"Two"}],"tap":null},"name":null,"thumbnailUrl":null}] State:{"Date":"0001-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":0,"Text":"some text here"} FromUser:"two" 1 -ToUserText:"Please enter a date and time for date " +ToUserText:"Date: Please enter a date and time for date " State:{"Date":"0001-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":2,"Text":"some text here"} FromUser:"1/1/2016" 2 -ToUserText:"**Results**\r\n* Text: some text here\r\n* Integer: 99\r\n* Float: 1.5\r\n* SomeChoices: Two\r\n* Date: 1/1/2016 12:00:00 AM" +ToUserText:"confirmation5: **Results**\r\n* Text: some text here\r\n* Integer: 99\r\n* Float: 1.5\r\n* SomeChoices: Two\r\n* Date: 1/1/2016 12:00:00 AM" ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"Is this what you wanted? ","images":null,"buttons":[{"type":"imBack","title":"Yes","image":null,"value":"Yes"},{"type":"imBack","title":"No","image":null,"value":"No"}],"tap":null},"name":null,"thumbnailUrl":null}] State:{"Date":"2016-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":2,"Text":"some text here"} FromUser:"no" 1 -ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"What do you want to change? ","images":null,"buttons":[{"type":"imBack","title":"Text(some text here)","image":null,"value":"Text"},{"type":"imBack","title":"Integer(99)","image":null,"value":"Integer"},{"type":"imBack","title":"Float(1.5)","image":null,"value":"Float"},{"type":"imBack","title":"Some Choices(Two)","image":null,"value":"Some Choices"},{"type":"imBack","title":"Date(1/1/2016 12:00:00 AM)","image":null,"value":"Date"},{"type":"imBack","title":"No Preference","image":null,"value":"No Preference"}],"tap":null},"name":null,"thumbnailUrl":null}] +ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"__navigate__: What do you want to change? ","images":null,"buttons":[{"type":"imBack","title":"Text(some text here)","image":null,"value":"Text"},{"type":"imBack","title":"Integer(99)","image":null,"value":"Integer"},{"type":"imBack","title":"Float(1.5)","image":null,"value":"Float"},{"type":"imBack","title":"Some Choices(Two)","image":null,"value":"Some Choices"},{"type":"imBack","title":"Date(1/1/2016 12:00:00 AM)","image":null,"value":"Date"},{"type":"imBack","title":"No Preference","image":null,"value":"No Preference"}],"tap":null},"name":null,"thumbnailUrl":null}] State:{"Date":"2016-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":2,"Text":"some text here"} FromUser:"text" 1 -ToUserText:"Please enter text (current choice: some text here)" +ToUserText:"Text: Please enter text (current choice: some text here)" State:{"Date":"2016-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":2,"Text":"some text here"} FromUser:"abc" 2 -ToUserText:"**Results**\r\n* Text: abc\r\n* Integer: 99\r\n* Float: 1.5\r\n* SomeChoices: Two\r\n* Date: 1/1/2016 12:00:00 AM" +ToUserText:"confirmation5: **Results**\r\n* Text: abc\r\n* Integer: 99\r\n* Float: 1.5\r\n* SomeChoices: Two\r\n* Date: 1/1/2016 12:00:00 AM" ToUserButtons:[{"contentType":"application/vnd.microsoft.card.hero","contentUrl":null,"content":{"title":"","subtitle":null,"text":"Is this what you wanted? ","images":null,"buttons":[{"type":"imBack","title":"Yes","image":null,"value":"Yes"},{"type":"imBack","title":"No","image":null,"value":"No"}],"tap":null},"name":null,"thumbnailUrl":null}] State:{"Date":"2016-01-01T00:00:00","Float":1.5,"Integer":99,"SomeChoices":2,"Text":"abc"} FromUser:"yes"