ConversationAdministrationClient.GetConversationAsync 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
GetConversationAsync(String, RequestContext) |
[Protocol Method] Gets the details of a specific conversation.
|
GetConversationAsync(String, CancellationToken) |
Gets the details of a specific conversation. |
GetConversationAsync(String, RequestContext)
[Protocol Method] Gets the details of a specific conversation.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetConversationAsync(String, CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Response> GetConversationAsync(string conversationId, Azure.RequestContext context);
abstract member GetConversationAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetConversationAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetConversationAsync (conversationId As String, context As RequestContext) As Task(Of Response)
Parameters
- conversationId
- String
The conversation ID.
- context
- RequestContext
The request context, 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.
Examples
This sample shows how to call GetConversationAsync and parse the result.
ConversationAdministrationClient client = new ConversationAdministrationClient((string)null);
Response response = await client.GetConversationAsync("<conversationId>", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
This sample shows how to call GetConversationAsync with all parameters and parse the result.
ConversationAdministrationClient client = new ConversationAdministrationClient((string)null);
Response response = await client.GetConversationAsync("<conversationId>", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("topic").ToString());
Console.WriteLine(result.GetProperty("deliveryChannelIds")[0].ToString());
Console.WriteLine(result.GetProperty("outboundDeliveryStrategy").ToString());
Console.WriteLine(result.GetProperty("participants")[0].GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("participants")[0].GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("participants")[0].GetProperty("kind").ToString());
Applies to
GetConversationAsync(String, CancellationToken)
Gets the details of a specific conversation.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.Messages.CommunicationConversation>> GetConversationAsync(string conversationId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetConversationAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Communication.Messages.CommunicationConversation>>
override this.GetConversationAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Communication.Messages.CommunicationConversation>>
Public Overridable Function GetConversationAsync (conversationId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of CommunicationConversation))
Parameters
- conversationId
- String
The conversation ID.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
conversationId
is null.
conversationId
is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call GetConversationAsync.
ConversationAdministrationClient client = new ConversationAdministrationClient((string)null);
Response<CommunicationConversation> response = await client.GetConversationAsync("<conversationId>");
This sample shows how to call GetConversationAsync with all parameters.
ConversationAdministrationClient client = new ConversationAdministrationClient((string)null);
Response<CommunicationConversation> response = await client.GetConversationAsync("<conversationId>");