IConversations.UploadAttachmentAsync Method

Definition

UploadAttachment.

public System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse> UploadAttachmentAsync(string conversationId, Microsoft.Agents.Connector.Types.AttachmentData attachmentUpload, System.Threading.CancellationToken cancellationToken = default);
abstract member UploadAttachmentAsync : string * Microsoft.Agents.Connector.Types.AttachmentData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse>
Public Function UploadAttachmentAsync (conversationId As String, attachmentUpload As AttachmentData, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResourceResponse)

Parameters

conversationId
String

Conversation ID.

attachmentUpload
AttachmentData

Attachment data.

cancellationToken
CancellationToken

The cancellation token.

Returns

A task that represents the ResourceResponse.

Remarks

Upload an attachment directly into a channel's 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.

Applies to