FaceSessionClient.GetLivenessWithVerifySessionResultAsync Method

Definition

Overloads

GetLivenessWithVerifySessionResultAsync(String, RequestContext)

[Protocol Method] Get session result of detectLivenessWithVerify/singleModal call.

GetLivenessWithVerifySessionResultAsync(String, CancellationToken)

Get session result of detectLivenessWithVerify/singleModal call.

GetLivenessWithVerifySessionResultAsync(String, RequestContext)

Source:
FaceSessionClient.cs

[Protocol Method] Get session result of detectLivenessWithVerify/singleModal call.

public virtual System.Threading.Tasks.Task<Azure.Response> GetLivenessWithVerifySessionResultAsync (string sessionId, Azure.RequestContext context);
abstract member GetLivenessWithVerifySessionResultAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetLivenessWithVerifySessionResultAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetLivenessWithVerifySessionResultAsync (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 GetLivenessWithVerifySessionResultAsync and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceSessionClient client = new FaceSessionClient(endpoint, credential);

Response response = await client.GetLivenessWithVerifySessionResultAsync("<sessionId>", 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());

This sample shows how to call GetLivenessWithVerifySessionResultAsync with all parameters and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceSessionClient client = new FaceSessionClient(endpoint, credential);

Response response = await client.GetLivenessWithVerifySessionResultAsync("<sessionId>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("sessionStartDateTime").ToString());
Console.WriteLine(result.GetProperty("sessionExpired").ToString());
Console.WriteLine(result.GetProperty("deviceCorrelationId").ToString());
Console.WriteLine(result.GetProperty("authTokenTimeToLiveInSeconds").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("sessionId").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("requestId").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("clientRequestId").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("receivedDateTime").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("request").GetProperty("url").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("request").GetProperty("method").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("request").GetProperty("contentLength").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("request").GetProperty("contentType").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("request").GetProperty("userAgent").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("livenessDecision").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("target").GetProperty("faceRectangle").GetProperty("top").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("target").GetProperty("faceRectangle").GetProperty("left").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("target").GetProperty("faceRectangle").GetProperty("width").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("target").GetProperty("faceRectangle").GetProperty("height").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("target").GetProperty("fileName").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("target").GetProperty("timeOffsetWithinFile").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("target").GetProperty("imageType").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("modelVersionUsed").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("verifyResult").GetProperty("verifyImage").GetProperty("faceRectangle").GetProperty("top").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("verifyResult").GetProperty("verifyImage").GetProperty("faceRectangle").GetProperty("left").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("verifyResult").GetProperty("verifyImage").GetProperty("faceRectangle").GetProperty("width").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("verifyResult").GetProperty("verifyImage").GetProperty("faceRectangle").GetProperty("height").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("verifyResult").GetProperty("verifyImage").GetProperty("qualityForRecognition").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("verifyResult").GetProperty("matchConfidence").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("body").GetProperty("verifyResult").GetProperty("isIdentical").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("statusCode").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("response").GetProperty("latencyInMilliseconds").ToString());
Console.WriteLine(result.GetProperty("result").GetProperty("digest").ToString());

Applies to

GetLivenessWithVerifySessionResultAsync(String, CancellationToken)

Source:
FaceSessionClient.cs

Get session result of detectLivenessWithVerify/singleModal call.

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

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 GetLivenessWithVerifySessionResultAsync.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceSessionClient client = new FaceSessionClient(endpoint, credential);

Response<LivenessWithVerifySession> response = await client.GetLivenessWithVerifySessionResultAsync("<sessionId>");

This sample shows how to call GetLivenessWithVerifySessionResultAsync with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceSessionClient client = new FaceSessionClient(endpoint, credential);

Response<LivenessWithVerifySession> response = await client.GetLivenessWithVerifySessionResultAsync("<sessionId>");

Applies to