WebPubSubChatServiceClient.GetMessagesAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| GetMessagesAsync(String, MessageQueryOptions, CancellationToken) |
Query messages in a conversation from latest to earliest. |
| GetMessagesAsync(String, String, String, Nullable<Int32>, RequestContext) |
[Protocol Method] Message IDs are used as pagination cursors. Follow the response nextLink, which contains the message ID cursor, to retrieve the next page.
|
GetMessagesAsync(String, MessageQueryOptions, CancellationToken)
Query messages in a conversation from latest to earliest.
public virtual Azure.AsyncPageable<Azure.Messaging.WebPubSub.Chat.WebPubSubChatMessage> GetMessagesAsync(string conversationId, Azure.Messaging.WebPubSub.Chat.MessageQueryOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetMessagesAsync : string * Azure.Messaging.WebPubSub.Chat.MessageQueryOptions * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Messaging.WebPubSub.Chat.WebPubSubChatMessage>
override this.GetMessagesAsync : string * Azure.Messaging.WebPubSub.Chat.MessageQueryOptions * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Messaging.WebPubSub.Chat.WebPubSubChatMessage>
Public Overridable Function GetMessagesAsync (conversationId As String, Optional options As MessageQueryOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of WebPubSubChatMessage)
Parameters
- conversationId
- String
Conversation identifier.
- options
- MessageQueryOptions
Options for querying messages.
- cancellationToken
- CancellationToken
The cancellation token that can be used to cancel the operation.
Returns
Exceptions
conversationId is null.
conversationId is an empty string, and was expected to be non-empty.
Service returned a non-success status code.
Remarks
Message IDs are pagination cursors. The returned pageable follows the response nextLink. Resume from a saved continuation token with AsPages(continuationToken).
Applies to
GetMessagesAsync(String, String, String, Nullable<Int32>, RequestContext)
[Protocol Method] Message IDs are used as pagination cursors. Follow the response nextLink, which contains the message ID cursor, to retrieve the next page.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.AsyncPageable<BinaryData> GetMessagesAsync(string conversationId, string latestMessageId, string earliestMessageId, int? maxPageSize, Azure.RequestContext context);
abstract member GetMessagesAsync : string * string * string * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetMessagesAsync : string * string * string * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetMessagesAsync (conversationId As String, latestMessageId As String, earliestMessageId As String, maxPageSize As Nullable(Of Integer), context As RequestContext) As AsyncPageable(Of BinaryData)
Parameters
- conversationId
- String
Conversation identifier.
- latestMessageId
- String
Latest message ID (exclusive) for pagination.
- earliestMessageId
- String
Earliest message ID (exclusive) for pagination.
- context
- RequestContext
The request options, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
conversationId is null.
conversationId is an empty string, and was expected to be non-empty.
Service returned a non-success status code.