Liveness Session Operations - Get Liveness Sessions

Lists sessions for /detectLiveness/SingleModal.
List sessions from the last sessionId greater than the 'start'.

The result should be ordered by sessionId in ascending order.

GET {endpoint}/face/{apiVersion}/detectLiveness/singleModal/sessions
GET {endpoint}/face/{apiVersion}/detectLiveness/singleModal/sessions?start={start}&top={top}

URI Parameters

Name In Required Type Description
apiVersion
path True

string

API Version

endpoint
path True

string

uri

Supported Cognitive Services endpoints (protocol and hostname, for example: https://{resource-name}.cognitiveservices.azure.com).

start
query

string

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

top
query

integer

int32

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

Responses

Name Type Description
200 OK

LivenessSessionItem[]

The request has succeeded.

Other Status Codes

FaceErrorResponse

An unexpected error response.

Headers

x-ms-error-code: string

Security

Ocp-Apim-Subscription-Key

The secret key for your Azure AI Face subscription.

Type: apiKey
In: header

AADToken

The Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: accessCode
Authorization URL: https://api.example.com/oauth2/authorize
Token URL: https://api.example.com/oauth2/token

Scopes

Name Description
https://cognitiveservices.azure.com/.default

Examples

Get LivenessSessions

Sample request

GET {endpoint}/face/v1.2-preview.1/detectLiveness/singleModal/sessions?start=00000000-0000-0000-0000-000000000000&top=20

Sample response

[
  {
    "id": "b12e033e-bda7-4b83-a211-e721c661f30e",
    "createdDateTime": "2024-03-05T11:07:28.540Z",
    "sessionStartDateTime": "2024-03-05T11:07:28.540Z",
    "sessionExpired": true,
    "deviceCorrelationId": "your_device_correlation_id",
    "authTokenTimeToLiveInSeconds": 60
  }
]

Definitions

Name Description
FaceError

The error object. For comprehensive details on error codes and messages returned by the Face Service, please refer to the following link: https://aka.ms/face-error-codes-and-messages.

FaceErrorResponse

A response containing error details.

LivenessSessionItem

Session data returned for enumeration.

FaceError

The error object. For comprehensive details on error codes and messages returned by the Face Service, please refer to the following link: https://aka.ms/face-error-codes-and-messages.

Name Type Description
code

string

One of a server-defined set of error codes.

message

string

A human-readable representation of the error.

FaceErrorResponse

A response containing error details.

Name Type Description
error

FaceError

The error object.

LivenessSessionItem

Session data returned for enumeration.

Name Type Default value Description
authTokenTimeToLiveInSeconds

integer

600

Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600.

createdDateTime

string

DateTime when this session was created.

deviceCorrelationId

string

Unique Guid per each end-user device. This is to provide rate limiting and anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be null.

id

string

The unique ID to reference this session.

sessionExpired

boolean

Whether or not the session is expired.

sessionStartDateTime

string

DateTime when this session was started by the client.