Microsoft.Bot.Connector.IConversations Interface Reference

Conversations operations. More...

Inheritance diagram for Microsoft.Bot.Connector.IConversations:

Public Member Functions

Task< HttpOperationResponse< object > > CreateConversationWithHttpMessagesAsync (ConversationParameters parameters, Dictionary< string, List< string >> customHeaders=null, CancellationToken cancellationToken=default(CancellationToken))
 CreateConversation More...
 
Task< HttpOperationResponse< ErrorResponse > > DeleteActivityWithHttpMessagesAsync (string conversationId, string activityId, Dictionary< string, List< string >> customHeaders=null, CancellationToken cancellationToken=default(CancellationToken))
 DeleteActivity More...
 
Task< HttpOperationResponse< object > > GetActivityMembersWithHttpMessagesAsync (string conversationId, string activityId, Dictionary< string, List< string >> customHeaders=null, CancellationToken cancellationToken=default(CancellationToken))
 GetActivityMembers More...
 
Task< HttpOperationResponse< object > > GetConversationMembersWithHttpMessagesAsync (string conversationId, Dictionary< string, List< string >> customHeaders=null, CancellationToken cancellationToken=default(CancellationToken))
 GetConversationMembers More...
 
Task< HttpOperationResponse< object > > ReplyToActivityWithHttpMessagesAsync (string conversationId, string activityId, Activity activity, Dictionary< string, List< string >> customHeaders=null, CancellationToken cancellationToken=default(CancellationToken))
 ReplyToActivity More...
 
Task< HttpOperationResponse< object > > SendToConversationWithHttpMessagesAsync (Activity activity, string conversationId, Dictionary< string, List< string >> customHeaders=null, CancellationToken cancellationToken=default(CancellationToken))
 SendToConversation More...
 
Task< HttpOperationResponse< object > > UpdateActivityWithHttpMessagesAsync (string conversationId, string activityId, Activity activity, Dictionary< string, List< string >> customHeaders=null, CancellationToken cancellationToken=default(CancellationToken))
 UpdateActivity More...
 
Task< HttpOperationResponse< object > > UploadAttachmentWithHttpMessagesAsync (string conversationId, AttachmentData attachmentUpload, Dictionary< string, List< string >> customHeaders=null, CancellationToken cancellationToken=default(CancellationToken))
 UploadAttachment More...
 

Detailed Description

Conversations operations.

Definition at line 18 of file IConversations.cs.

Member Function Documentation

Task<HttpOperationResponse<object> > Microsoft.Bot.Connector.IConversations.CreateConversationWithHttpMessagesAsync ( ConversationParameters  parameters,
Dictionary< string, List< string >>  customHeaders = null,
CancellationToken  cancellationToken = default(CancellationToken) 
)

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
parametersParameters to create the conversation from
customHeadersThe headers that will be added to request.
cancellationTokenThe cancellation token.

Implemented in Microsoft.Bot.Connector.Conversations.

Task<HttpOperationResponse<ErrorResponse> > Microsoft.Bot.Connector.IConversations.DeleteActivityWithHttpMessagesAsync ( string  conversationId,
string  activityId,
Dictionary< string, List< string >>  customHeaders = null,
CancellationToken  cancellationToken = default(CancellationToken) 
)

DeleteActivity

Delete an existing activity.

Some channels allow you to delete an existing activity, and if successful this method will remove the specified activity.

Parameters
conversationIdConversation ID
activityIdactivityId to delete
customHeadersThe headers that will be added to request.
cancellationTokenThe cancellation token.

Implemented in Microsoft.Bot.Connector.Conversations.

Task<HttpOperationResponse<object> > Microsoft.Bot.Connector.IConversations.GetActivityMembersWithHttpMessagesAsync ( string  conversationId,
string  activityId,
Dictionary< string, List< string >>  customHeaders = null,
CancellationToken  cancellationToken = default(CancellationToken) 
)

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.

Parameters
conversationIdConversation ID
activityIdActivity ID
customHeadersThe headers that will be added to request.
cancellationTokenThe cancellation token.

Implemented in Microsoft.Bot.Connector.Conversations.

Task<HttpOperationResponse<object> > Microsoft.Bot.Connector.IConversations.GetConversationMembersWithHttpMessagesAsync ( string  conversationId,
Dictionary< string, List< string >>  customHeaders = null,
CancellationToken  cancellationToken = default(CancellationToken) 
)

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.

Parameters
conversationIdConversation ID
customHeadersThe headers that will be added to request.
cancellationTokenThe cancellation token.

Implemented in Microsoft.Bot.Connector.Conversations.

Task<HttpOperationResponse<object> > Microsoft.Bot.Connector.IConversations.ReplyToActivityWithHttpMessagesAsync ( string  conversationId,
string  activityId,
Activity  activity,
Dictionary< string, List< string >>  customHeaders = null,
CancellationToken  cancellationToken = default(CancellationToken) 
)

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.

Parameters
conversationIdConversation ID
activityIdactivityId the reply is to (OPTIONAL)
activityActivity to send
customHeadersThe headers that will be added to request.
cancellationTokenThe cancellation token.

Implemented in Microsoft.Bot.Connector.Conversations.

Task<HttpOperationResponse<object> > Microsoft.Bot.Connector.IConversations.SendToConversationWithHttpMessagesAsync ( Activity  activity,
string  conversationId,
Dictionary< string, List< string >>  customHeaders = null,
CancellationToken  cancellationToken = default(CancellationToken) 
)

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.

Parameters
activityActivity to send
conversationIdConversation ID
customHeadersThe headers that will be added to request.
cancellationTokenThe cancellation token.

Implemented in Microsoft.Bot.Connector.Conversations.

Task<HttpOperationResponse<object> > Microsoft.Bot.Connector.IConversations.UpdateActivityWithHttpMessagesAsync ( string  conversationId,
string  activityId,
Activity  activity,
Dictionary< string, List< string >>  customHeaders = null,
CancellationToken  cancellationToken = default(CancellationToken) 
)

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.

Parameters
conversationIdConversation ID
activityIdactivityId to update
activityreplacement Activity
customHeadersThe headers that will be added to request.
cancellationTokenThe cancellation token.

Implemented in Microsoft.Bot.Connector.Conversations.

Task<HttpOperationResponse<object> > Microsoft.Bot.Connector.IConversations.UploadAttachmentWithHttpMessagesAsync ( string  conversationId,
AttachmentData  attachmentUpload,
Dictionary< string, List< string >>  customHeaders = null,
CancellationToken  cancellationToken = default(CancellationToken) 
)

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.

Parameters
conversationIdConversation ID
attachmentUploadAttachment data
customHeadersThe headers that will be added to request.
cancellationTokenThe cancellation token.

Implemented in Microsoft.Bot.Connector.Conversations.


The documentation for this interface was generated from the following file: