FaceSessionClient.GetLivenessWithVerifySessionsAsync Method

Definition

Overloads

GetLivenessWithVerifySessionsAsync(String, Nullable<Int32>, CancellationToken)

Lists sessions for /detectLivenessWithVerify/SingleModal.

GetLivenessWithVerifySessionsAsync(String, Nullable<Int32>, RequestContext)

[Protocol Method] Lists sessions for /detectLivenessWithVerify/SingleModal.

GetLivenessWithVerifySessionsAsync(String, Nullable<Int32>, CancellationToken)

Source:
FaceSessionClient.cs

Lists sessions for /detectLivenessWithVerify/SingleModal.

public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Vision.Face.LivenessSessionItem>>> GetLivenessWithVerifySessionsAsync (string start = default, int? top = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetLivenessWithVerifySessionsAsync : string * Nullable<int> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Vision.Face.LivenessSessionItem>>>
override this.GetLivenessWithVerifySessionsAsync : string * Nullable<int> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Vision.Face.LivenessSessionItem>>>
Public Overridable Function GetLivenessWithVerifySessionsAsync (Optional start As String = Nothing, Optional top As Nullable(Of Integer) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of IReadOnlyList(Of LivenessSessionItem)))

Parameters

start
String

List resources greater than the "start". It contains no more than 64 characters. Default is empty.

top
Nullable<Int32>

The number of items to list, ranging in [1, 1000]. Default is 1000.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetLivenessWithVerifySessionsAsync.

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

Response<IReadOnlyList<LivenessSessionItem>> response = await client.GetLivenessWithVerifySessionsAsync();

This sample shows how to call GetLivenessWithVerifySessionsAsync with all parameters.

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

Response<IReadOnlyList<LivenessSessionItem>> response = await client.GetLivenessWithVerifySessionsAsync(start: "<start>", top: 1234);

Remarks

List sessions from the last sessionId greater than the "start".

The result should be ordered by sessionId in ascending order.

Applies to

GetLivenessWithVerifySessionsAsync(String, Nullable<Int32>, RequestContext)

Source:
FaceSessionClient.cs

[Protocol Method] Lists sessions for /detectLivenessWithVerify/SingleModal.

public virtual System.Threading.Tasks.Task<Azure.Response> GetLivenessWithVerifySessionsAsync (string start, int? top, Azure.RequestContext context);
abstract member GetLivenessWithVerifySessionsAsync : string * Nullable<int> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetLivenessWithVerifySessionsAsync : string * Nullable<int> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetLivenessWithVerifySessionsAsync (start As String, top As Nullable(Of Integer), context As RequestContext) As Task(Of Response)

Parameters

start
String

List resources greater than the "start". It contains no more than 64 characters. Default is empty.

top
Nullable<Int32>

The number of items to list, ranging in [1, 1000]. Default is 1000.

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

Service returned a non-success status code.

Examples

This sample shows how to call GetLivenessWithVerifySessionsAsync 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.GetLivenessWithVerifySessionsAsync(null, null, null);

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

This sample shows how to call GetLivenessWithVerifySessionsAsync 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.GetLivenessWithVerifySessionsAsync("<start>", 1234, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result[0].GetProperty("id").ToString());
Console.WriteLine(result[0].GetProperty("createdDateTime").ToString());
Console.WriteLine(result[0].GetProperty("sessionStartDateTime").ToString());
Console.WriteLine(result[0].GetProperty("sessionExpired").ToString());
Console.WriteLine(result[0].GetProperty("deviceCorrelationId").ToString());
Console.WriteLine(result[0].GetProperty("authTokenTimeToLiveInSeconds").ToString());

Applies to