Freigeben über


FaceSessionClient.GetLivenessSessions Method

Definition

Overloads

GetLivenessSessions(String, Nullable<Int32>, RequestContext)

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

GetLivenessSessions(String, Nullable<Int32>, CancellationToken)

Lists sessions for /detectLiveness/SingleModal.

GetLivenessSessions(String, Nullable<Int32>, RequestContext)

Source:
FaceSessionClient.cs

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

public virtual Azure.Response GetLivenessSessions (string start, int? top, Azure.RequestContext context);
abstract member GetLivenessSessions : string * Nullable<int> * Azure.RequestContext -> Azure.Response
override this.GetLivenessSessions : string * Nullable<int> * Azure.RequestContext -> Azure.Response
Public Overridable Function GetLivenessSessions (start As String, top As Nullable(Of Integer), context As RequestContext) As 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 GetLivenessSessions and parse the result.

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

Response response = client.GetLivenessSessions("00000000-0000-0000-0000-000000000000", 20, 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());

Applies to

GetLivenessSessions(String, Nullable<Int32>, CancellationToken)

Source:
FaceSessionClient.cs

Lists sessions for /detectLiveness/SingleModal.

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

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

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

Remarks

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

Applies to