liveness_sessions
Creates, updates, deletes, gets or lists a liveness_sessions resource.
Overview
| Name | liveness_sessions |
| Type | Resource |
| Id | azure.ai_vision_face.liveness_sessions |
Fields
The following fields are returned by SELECT queries:
- get_liveness_sessions
| Name | Datatype | Description |
|---|---|---|
id | string | The unique ID to reference this session. Required. |
authTokenTimeToLiveInSeconds | integer | Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600. |
createdDateTime | string (date-time) | DateTime when this session was created. Required. |
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. |
sessionExpired | boolean | Whether or not the session is expired. Required. |
sessionStartDateTime | string (date-time) | DateTime when this session was started by the client. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_liveness_sessions | select | endpoint, api_version | start, top | Lists sessions for /detectLiveness/SingleModal. Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for more details. |
create_liveness_session | insert | endpoint, api_version, livenessOperationMode | Create a new detect liveness session. Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-session for more details. | |
delete_liveness_session | delete | session_id, endpoint, api_version | Delete all session related information for matching the specified session id. Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-session for more details. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_version | string | The service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client apiVersion parameter. (default: ) |
endpoint | string | The service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: ) |
session_id | string | The unique ID to reference this session. Required. |
start | string | List resources greater than the "start". It contains no more than 64 characters. Default is empty. Default value is None. |
top | integer | The number of items to list, ranging in [1, 1000]. Default is 1000. Default value is None. |
SELECT examples
- get_liveness_sessions
Lists sessions for /detectLiveness/SingleModal. Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for more details.
SELECT
id,
authTokenTimeToLiveInSeconds,
createdDateTime,
deviceCorrelationId,
sessionExpired,
sessionStartDateTime
FROM azure.ai_vision_face.liveness_sessions
WHERE endpoint = '{{ endpoint }}' -- required
AND api_version = '{{ api_version }}' -- required
AND start = '{{ start }}'
AND top = '{{ top }}'
;
INSERT examples
- create_liveness_session
- Manifest
Create a new detect liveness session. Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-session for more details.
INSERT INTO azure.ai_vision_face.liveness_sessions (
livenessOperationMode,
sendResultsToClient,
deviceCorrelationIdSetInClient,
enableSessionImage,
livenessSingleModalModel,
deviceCorrelationId,
authTokenTimeToLiveInSeconds,
endpoint,
api_version
)
SELECT
'{{ livenessOperationMode }}' /* required */,
{{ sendResultsToClient }},
{{ deviceCorrelationIdSetInClient }},
{{ enableSessionImage }},
'{{ livenessSingleModalModel }}',
'{{ deviceCorrelationId }}',
{{ authTokenTimeToLiveInSeconds }},
'{{ endpoint }}',
'{{ api_version }}'
RETURNING
authToken,
sessionId
;
# Description fields are for documentation purposes
- name: liveness_sessions
props:
- name: endpoint
value: "{{ endpoint }}"
description: Required parameter for the liveness_sessions resource.
- name: api_version
value: "{{ api_version }}"
description: Required parameter for the liveness_sessions resource.
- name: livenessOperationMode
value: "{{ livenessOperationMode }}"
description: |
Type of liveness mode the client should follow. Required. Known values are: "Passive" and "PassiveActive".
valid_values: ['Passive', 'PassiveActive']
- name: sendResultsToClient
value: {{ sendResultsToClient }}
description: |
Whether or not to allow a '200 - Success' response body to be sent to the client, which may be undesirable for security reasons. Default is false, clients will receive a '204 - NoContent' empty body response. Regardless of selection, calling Session GetResult will always contain a response body enabling business logic to be implemented.
- name: deviceCorrelationIdSetInClient
value: {{ deviceCorrelationIdSetInClient }}
description: |
Whether or not to allow client to set their own 'deviceCorrelationId' via the Vision SDK. Default is false, and 'deviceCorrelationId' must be set in this request body.
- name: enableSessionImage
value: {{ enableSessionImage }}
description: |
Whether or not store the session image.
- name: livenessSingleModalModel
value: "{{ livenessSingleModalModel }}"
description: |
The model version used for liveness classification. This is an optional parameter, and if this is not specified, then the latest supported model version will be chosen. Known values are: "2022-10-15-preview.04" and "2023-12-20-preview.06".
valid_values: ['2022-10-15-preview.04', '2023-12-20-preview.06']
- name: deviceCorrelationId
value: "{{ deviceCorrelationId }}"
description: |
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.
- name: authTokenTimeToLiveInSeconds
value: {{ authTokenTimeToLiveInSeconds }}
description: |
Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600.
DELETE examples
- delete_liveness_session
Delete all session related information for matching the specified session id. Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-session for more details.
DELETE FROM azure.ai_vision_face.liveness_sessions
WHERE session_id = '{{ session_id }}' --required
AND endpoint = '{{ endpoint }}' --required
AND api_version = '{{ api_version }}' --required
;