Udostępnij za pośrednictwem


FaceSessionClient.GetLivenessSessionResultAsync Method

Definition

Overloads

GetLivenessSessionResultAsync(String, RequestContext)

[Protocol Method] Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result for more details.

GetLivenessSessionResultAsync(String, CancellationToken)

Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result for more details.

GetLivenessSessionResultAsync(String, RequestContext)

Source:
FaceSessionClient.cs

[Protocol Method] Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result for more details.

public virtual System.Threading.Tasks.Task<Azure.Response> GetLivenessSessionResultAsync (string sessionId, Azure.RequestContext context);
abstract member GetLivenessSessionResultAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetLivenessSessionResultAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetLivenessSessionResultAsync (sessionId As String, context As RequestContext) As Task(Of Response)

Parameters

sessionId
String

The unique ID to reference this session.

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

sessionId is null.

sessionId 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 GetLivenessSessionResultAsync and parse the result.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceSessionClient client = new FaceSessionClient(endpoint, credential);

Response response = await client.GetLivenessSessionResultAsync("b12e033e-bda7-4b83-a211-e721c661f30e", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("sessionExpired").ToString());
Console.WriteLine(result.GetProperty("status").ToString());

Applies to

GetLivenessSessionResultAsync(String, CancellationToken)

Source:
FaceSessionClient.cs
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Vision.Face.LivenessSession>> GetLivenessSessionResultAsync (string sessionId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetLivenessSessionResultAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Vision.Face.LivenessSession>>
override this.GetLivenessSessionResultAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Vision.Face.LivenessSession>>
Public Overridable Function GetLivenessSessionResultAsync (sessionId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of LivenessSession))

Parameters

sessionId
String

The unique ID to reference this session.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

sessionId is null.

sessionId is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetLivenessSessionResultAsync.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceSessionClient client = new FaceSessionClient(endpoint, credential);

Response<LivenessSession> response = await client.GetLivenessSessionResultAsync("b12e033e-bda7-4b83-a211-e721c661f30e");

Applies to