REST API Reference¶
Analysis¶
Analyze the provided facial images and determine liveness and other autocapture information.¶
- POST /analyze
Analyze the provided facial images and determine liveness and other autocapture information.
Please Note:
Recommended resolution for provided images is 480x640.
All images within a single request must have the same width and height.
The recommended number of pixels between the subject’s eyes is 90 when using a front camera, and 60 with a back camera.
Request schema:
Name
Type
Description
video
object
Video object
meta_data
workflow_data
Example request:
POST /analyze HTTP/1.1 Host: example.com Content-Type: text/plain { "video": { "meta_data": { "client_device_brand": "Apple", "client_device_model": "iPhone 8", "client_os_version": "11.0.3", "client_version": "KnomiSLive_v:2.4.1_b:0.0.0_sdk_v:2.4.1_b:0.0.0", "localization": "en-US", "programming_language_version": "Swift 4.1", "username": "test" }, "workflow_data": { "workflow": "charlie4", "frames": [ { "data": "<base64 encoded image>", "tags": [], "timestamp": 1581714134137 }, { "data": "<base64 encoded image>", "tags": [], "timestamp": 1581714134158 }, { "data": "<base64 encoded image>", "tags": [], "timestamp": 1581714134189 } ] } } }
- Status Codes:
200 OK – Success
400 Bad Request – The request is not valid
500 Internal Server Error – Internal error. Please see Error Codes section for detailed information.
200 Response schema:
Name
Type
Description
video
object
Video object
autocapture_result
liveness_result
version
string
The current version of the Aware Face Liveness library.
Example response:
HTTP/1.1 200 OK Content-Type: text/plain { "video": { "autocapture_result": { "captured_frame": "<base64 encoded image>", "captured_frame_is_constructed": false, "feedback": [] }, "liveness_result": { "decision": "LIVE", "feedback": [], "score": 100, "score_frr": 0.5301376318487142 }, "version": "Aware FaceLiveness Library, version x.x.x" } }
400 Response schema:
Name
Type
Description
error
object
code
integer
Error code Values: -1 (Unknown Error), -2 (Invalid Input JSON), -3 (Missing Mandatory Field), -4 (Field Has Wrong Type), -5 (Invalid Base64 String), -6 (Invalid Value), -7 (Invalid Image Data), -8 (Invalid Image Size)
description
string
Error description
Example response:
HTTP/1.1 400 Bad Request Content-Type: text/plain { "error": { "code": -2, "description": "Request was not valid JSON." } }
500 Response schema:
Name
Type
Description
error
object
code
integer
Error code (see table below)
description
string
Error description
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: text/plain { "error": { "code": "", "description": "" } }
Encrypted version of analyze endpoint.¶
- POST /analyzeEncrypted
Encrypted version of analyze endpoint.
Please Note:
Encrypted request data is generated by Knomi software.
Request schema:
Name
Type
Description
key
string
Encrypted request ‘key’ value
iv
string
Encrypted request ‘iv’ value
p
string
Encrypted request ‘p’ value
Example request:
POST /analyzeEncrypted HTTP/1.1 Host: example.com Content-Type: text/plain { "key": "string", "iv": "string", "p": "string" }
- Status Codes:
200 OK – Success
400 Bad Request – The request is not valid
500 Internal Server Error – Internal error. Please see Error Codes section for detailed information.
200 Response schema:
Name
Type
Description
video
object
Video object
autocapture_result
liveness_result
version
string
The current version of the Aware Face Liveness library.
Example response:
HTTP/1.1 200 OK Content-Type: text/plain { "video": { "autocapture_result": { "captured_frame": "<base64 encoded image>", "captured_frame_is_constructed": false, "feedback": [] }, "liveness_result": { "decision": "LIVE", "feedback": [], "score": 100, "score_frr": 0.5301376318487142 }, "version": "Aware FaceLiveness Library, version x.x.x" } }
400 Response schema:
Name
Type
Description
error
object
code
integer
Error code Values: -1 (Unknown Error), -2 (Invalid Input JSON), -3 (Missing Mandatory Field), -4 (Field Has Wrong Type), -5 (Invalid Base64 String), -6 (Invalid Value), -7 (Invalid Image Data), -8 (Invalid Image Size)
description
string
Error description
Example response:
HTTP/1.1 400 Bad Request Content-Type: text/plain { "error": { "code": -2, "description": "Request was not valid JSON." } }
500 Response schema:
Name
Type
Description
error
object
code
integer
Error code (see table below)
description
string
Error description
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: text/plain { "error": { "code": "", "description": "" } }
Check liveness¶
Analyze the provided facial images and determine liveness.¶
- POST /checkLiveness
Analyze the provided facial images and determine liveness.
Please Note:
Recommended resolution for provided images is 480x640.
All images within a single request must have the same width and height.
The recommended number of pixels between the subject’s eyes is 90 when using a front camera, and 60 with a back camera.
Request schema:
Name
Type
Description
video
object
Video object
meta_data
workflow_data
Example request:
POST /checkLiveness HTTP/1.1 Host: example.com Content-Type: text/plain { "video": { "meta_data": { "client_device_brand": "Apple", "client_device_model": "iPhone 8", "client_os_version": "11.0.3", "client_version": "KnomiSLive_v:2.4.1_b:0.0.0_sdk_v:2.4.1_b:0.0.0", "localization": "en-US", "programming_language_version": "Swift 4.1", "username": "test" }, "workflow_data": { "workflow": "charlie4", "frames": [ { "data": "<base64 encoded image>", "tags": [], "timestamp": 1581714134137 }, { "data": "<base64 encoded image>", "tags": [], "timestamp": 1581714134158 }, { "data": "<base64 encoded image>", "tags": [], "timestamp": 1581714134189 } ] } } }
- Status Codes:
200 OK – Success
400 Bad Request – The request is not valid
500 Internal Server Error – Internal error. Please see Error Codes section for detailed information.
200 Response schema:
Name
Type
Description
video
object
Video object
liveness_result
version
string
The current version of the Aware Face Liveness library.
Example response:
HTTP/1.1 200 OK Content-Type: text/plain { "video": { "liveness_result": { "decision": "LIVE", "feedback": [], "score_frr": 0.5301376318487142 }, "version": "Aware FaceLiveness Library, version x.x.x" } }
400 Response schema:
Name
Type
Description
error
object
code
integer
Error code Values: -1 (Unknown Error), -2 (Invalid Input JSON), -3 (Missing Mandatory Field), -4 (Field Has Wrong Type), -5 (Invalid Base64 String), -6 (Invalid Value), -7 (Invalid Image Data), -8 (Invalid Image Size)
description
string
Error description
Example response:
HTTP/1.1 400 Bad Request Content-Type: text/plain { "error": { "code": -2, "description": "Request was not valid JSON." } }
500 Response schema:
Name
Type
Description
error
object
code
integer
Error code (see table below)
description
string
Error description
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: text/plain { "error": { "code": "", "description": "" } }
Encrypted version of checkLiveness endpoint.¶
- POST /checkLivenessEncrypted
Encrypted version of checkLiveness endpoint.
Please Note:
Encrypted request data is generated by Knomi software.
Request schema:
Name
Type
Description
key
string
Encrypted request ‘key’ value
iv
string
Encrypted request ‘iv’ value
p
string
Encrypted request ‘p’ value
Example request:
POST /checkLivenessEncrypted HTTP/1.1 Host: example.com Content-Type: text/plain { "key": "string", "iv": "string", "p": "string" }
- Status Codes:
200 OK – Success
400 Bad Request – The request is not valid
500 Internal Server Error – Internal error. Please see Error Codes section for detailed information.
200 Response schema:
Name
Type
Description
video
object
Video object
liveness_result
version
string
The current version of the Aware Face Liveness library.
Example response:
HTTP/1.1 200 OK Content-Type: text/plain { "video": { "liveness_result": { "decision": "LIVE", "feedback": [], "score_frr": 0.5301376318487142 }, "version": "Aware FaceLiveness Library, version x.x.x" } }
400 Response schema:
Name
Type
Description
error
object
code
integer
Error code Values: -1 (Unknown Error), -2 (Invalid Input JSON), -3 (Missing Mandatory Field), -4 (Field Has Wrong Type), -5 (Invalid Base64 String), -6 (Invalid Value), -7 (Invalid Image Data), -8 (Invalid Image Size)
description
string
Error description
Example response:
HTTP/1.1 400 Bad Request Content-Type: text/plain { "error": { "code": -2, "description": "Request was not valid JSON." } }
500 Response schema:
Name
Type
Description
error
object
code
integer
Error code (see table below)
description
string
Error description
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: text/plain { "error": { "code": "", "description": "" } }
Analyze the provided facial images and determine liveness. This request includes two active liveness requests.¶
- POST /checkActiveLiveness
Analyze the provided facial images and determine liveness. This request includes two active liveness requests.
Please Note:
Recommended resolution for provided images is 480x640.
All images within a single request must have the same width and height.
The recommended number of pixels between the subject’s eyes is 90 when using a front camera, and 60 with a back camera.
Request schema:
array of faceLivenessRequest - The array must have a size of 3 containing 1 request with a passive workflow and 2 requests with an active workflow.
Example request:
POST /checkActiveLiveness HTTP/1.1 Host: example.com Content-Type: text/plain [ { "video": { "meta_data": { "client_device_brand": "Apple", "client_device_model": "iPhone 8", "client_os_version": "11.0.3", "client_version": "KnomiSLive_v:2.4.1_b:0.0.0_sdk_v:2.4.1_b:0.0.0", "localization": "en-US", "programming_language_version": "Swift 4.1", "username": "test" }, "workflow_data": { "workflow": "foxtrot4", "frames": [ { "data": "<base64 encoded image>", "tags": [], "timestamp": 1594826616671 } ] } } }, { "video": { "meta_data": { "client_device_brand": "Apple", "client_device_model": "iPhone 8", "client_os_version": "11.0.3", "client_version": "KnomiSLive_v:2.4.1_b:0.0.0_sdk_v:2.4.1_b:0.0.0", "localization": "en-US", "programming_language_version": "Swift 4.1", "username": "test" }, "workflow_data": { "workflow": "active_up", "frames": [ { "data": "<base64 encoded image>", "tags": [ "ACTIVE_HEAD_UP" ], "timestamp": 1594826616692 } ] } } }, { "video": { "meta_data": { "client_device_brand": "Apple", "client_device_model": "iPhone 8", "client_os_version": "11.0.3", "client_version": "KnomiSLive_v:2.4.1_b:0.0.0_sdk_v:2.4.1_b:0.0.0", "localization": "en-US", "programming_language_version": "Swift 4.1", "username": "test" }, "workflow_data": { "workflow": "active_down", "frames": [ { "data": "<base64 encoded image>", "tags": [ "ACTIVE_HEAD_DOWN" ], "timestamp": 1594826616883 } ] } } } ]
- Status Codes:
200 OK – Success
400 Bad Request – The request is not valid
500 Internal Server Error – Internal error. Please see Error Codes section for detailed information.
200 Response schema:
Name
Type
Description
video
object
Video object
liveness_result
version
string
The current version of the Aware Face Liveness library.
Example response:
HTTP/1.1 200 OK Content-Type: text/plain { "video": { "liveness_result": { "decision": "LIVE", "feedback": [], "score_frr": 0.5301376318487142, "details": { "active_liveness": { "decision": "LIVE", "feedback": [], "score_frr": 0.5301376318487142 }, "passive_liveness": { "decision": "LIVE", "feedback": [], "score_frr": 0.5301376318487142 } } }, "version": "Aware FaceLiveness Library, version x.x.x" } }
400 Response schema:
Name
Type
Description
error
object
code
integer
Error code Values: -1 (Unknown Error), -2 (Invalid Input JSON), -3 (Missing Mandatory Field), -4 (Field Has Wrong Type), -5 (Invalid Base64 String), -6 (Invalid Value), -7 (Invalid Image Data), -8 (Invalid Image Size)
description
string
Error description
Example response:
HTTP/1.1 400 Bad Request Content-Type: text/plain { "error": { "code": -2, "description": "Request was not valid JSON." } }
500 Response schema:
Name
Type
Description
error
object
code
integer
Error code (see table below)
description
string
Error description
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: text/plain { "error": { "code": "", "description": "" } }
Encrypted version of checkActiveLiveness endpoint.¶
- POST /checkActiveLivenessEncrypted
Encrypted version of checkActiveLiveness endpoint.
Please Note:
Encrypted request data is generated by Knomi software.
Request schema:
Name
Type
Description
key
string
Encrypted request ‘key’ value
iv
string
Encrypted request ‘iv’ value
p
string
Encrypted request ‘p’ value
Example request:
POST /checkActiveLivenessEncrypted HTTP/1.1 Host: example.com Content-Type: text/plain { "key": "string", "iv": "string", "p": "string" }
- Status Codes:
200 OK – Success
400 Bad Request – The request is not valid
500 Internal Server Error – Internal error. Please see Error Codes section for detailed information.
200 Response schema:
Name
Type
Description
video
object
Video object
liveness_result
version
string
The current version of the Aware Face Liveness library.
Example response:
HTTP/1.1 200 OK Content-Type: text/plain { "video": { "liveness_result": { "decision": "LIVE", "feedback": [], "score_frr": 0.5301376318487142, "details": { "active_liveness": { "decision": "LIVE", "feedback": [], "score_frr": 0.5301376318487142 }, "passive_liveness": { "decision": "LIVE", "feedback": [], "score_frr": 0.5301376318487142 } } }, "version": "Aware FaceLiveness Library, version x.x.x" } }
400 Response schema:
Name
Type
Description
error
object
code
integer
Error code Values: -1 (Unknown Error), -2 (Invalid Input JSON), -3 (Missing Mandatory Field), -4 (Field Has Wrong Type), -5 (Invalid Base64 String), -6 (Invalid Value), -7 (Invalid Image Data), -8 (Invalid Image Size)
description
string
Error description
Example response:
HTTP/1.1 400 Bad Request Content-Type: text/plain { "error": { "code": -2, "description": "Request was not valid JSON." } }
500 Response schema:
Name
Type
Description
error
object
code
integer
Error code (see table below)
description
string
Error description
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: text/plain { "error": { "code": "", "description": "" } }
Decryption¶
General decryption endpoint.¶
- POST /decrypt
General decryption endpoint.
Please Note:
Encrypted request data is generated by Knomi software.
Will decrypt any package and return the original unencrypted JSON package.
Request schema:
Name
Type
Description
key
string
Encrypted request ‘key’ value
iv
string
Encrypted request ‘iv’ value
p
string
Encrypted request ‘p’ value
Example request:
POST /decrypt HTTP/1.1 Host: example.com Content-Type: text/plain { "key": "string", "iv": "string", "p": "string" }
- Status Codes:
200 OK – Success
400 Bad Request – The request is not valid
500 Internal Server Error – Internal error. Please see Error Codes section for detailed information.
200 Response schema:
Output JSON schema is identical to the original unencrypted package.
Example response:
HTTP/1.1 200 OK Content-Type: text/plain {}
400 Response schema:
Name
Type
Description
error
object
code
integer
Error code Values: -1 (Unknown Error), -2 (Invalid Input JSON), -3 (Missing Mandatory Field), -4 (Field Has Wrong Type), -5 (Invalid Base64 String), -6 (Invalid Value), -7 (Invalid Image Data), -8 (Invalid Image Size)
description
string
Error description
Example response:
HTTP/1.1 400 Bad Request Content-Type: text/plain { "error": { "code": -2, "description": "Request was not valid JSON." } }
500 Response schema:
Name
Type
Description
error
object
code
integer
Error code (see table below)
description
string
Error description
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: text/plain { "error": { "code": "", "description": "" } }
General¶
Version of knomi faceliveness server¶
- GET /version
Version of knomi faceliveness server
Returns the version of knomi faceliveness server
- Status Codes:
200 OK – OK
500 Internal Server Error – Internal error. Please see Error Codes section for detailed information.
200 Response schema:
string
Example response:
HTTP/1.1 200 OK Content-Type: text/plain Aware FaceLiveness Library, version x.x.x
500 Response schema:
Name
Type
Description
error
object
code
integer
Error code (see table below)
description
string
Error description
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: text/plain { "error": { "code": "", "description": "" } }
Structure Reference¶
faceLivenessRequest Model Structure¶
Name
Type
Description
video
object
Video object
meta_data
workflow_data
faceLivenessRequestEncrypted Model Structure¶
Name
Type
Description
key
string
Encrypted request ‘key’ value
iv
string
Encrypted request ‘iv’ value
p
string
Encrypted request ‘p’ value
activeLivenessRequest Model Structure¶
Name
Type
Description
activeLivenessRequest
(array of activeLivenessRequest)
The array must have a size of 3 containing 1 request with a passive workflow and 2 requests with an active workflow.
analyzeResponse Model Structure¶
Name
Type
Description
video
object
Video object
autocapture_result
liveness_result
version
string
The current version of the Aware Face Liveness library.
faceLivenessResponse Model Structure¶
Name
Type
Description
video
object
Video object
liveness_result
version
string
The current version of the Aware Face Liveness library.
activeLivenessResponse Model Structure¶
Name
Type
Description
video
object
Video object
liveness_result
version
string
The current version of the Aware Face Liveness library.
decryptResponse Model Structure¶
Output JSON schema is identical to the original unencrypted package.
autocapture_result Model Structure¶
Autocapture result
Name
Type
Description
captured_frame
string
Captured frame in base64 format.
captured_frame_is_constructed
boolean
If the captured frame is constructed image or not. Request can set perform_construction field to tell server to construct the captured image if it can be done.
feedback
(array of string)
Autocapture feedback
liveness_result Model Structure¶
Liveness result object
Name
Type
Description
feedback
(array of string)
Liveness feedback.
score
number
Liveness score Values: -1.0 (Error), 0.0 (Not Live), 100.0 (Live)
decision
string
classify liveness score to result type Values: LIVE (score 100), SPOOF (score 0), TOO_BLURRY (blur detection resulted too high), FACE_TOO_LOW_RESOLUTION (eye separation check resulted in too few pixels), TOO_LOW_FACIAL_DYNAMIC_RANGE (face detected had too low of a facial dynamic range score), UNABLE_TO_CALCULATE_LIVENESS (error score -1), TIMESTAMP_TOO_OLD (timestamp is too old), TIMESTAMP_IN_FUTURE (timestamp is in the future)
score_frr
number
Score used to threshold by false rejection rate. See the manual for more info.
active_liveness_result Model Structure¶
Active Liveness result object
Name
Type
Description
feedback
feedback
score
score
decision
decision
score_frr
score_frr
details
object
Object containing separated passive and active liveness results.
passive_liveness
active_liveness
meta_data Model Structure¶
(Optional) Metadata assocated with the transaction
Name
Type
Description
username
string
(Optional) Username associated with the transaction
client_device_brand
string
(Optional) Client’s device brand
client_device_model
string
(Optional) Client’s device model
client_os_version
string
(Optional) Client’s os version
client_version
string
(Optional) Client’s application version
localization
string
(Optional) Client’s localization
programming_language_version
string
(Optional) Client’s programming language version
workflow_data Model Structure¶
Parameters used in the workflow
Name
Type
Description
workflow
string
The workflow to be used for the request. Values: charlie2, charlie4, charlie6, foxtrot2, foxtrot4, foxtrot6, hotel2, hotel4, hotel6, active_down, active_left, active_right, active_up
frames
(array of frames)
A list of frame object
security_level
integer
(Optional) The parameter controls the balance of usability versus security.
timestamp
number
(Optional) The timestamp the package was created.
face_detection_granularity
number
(Optional) Face detection granularity
face_detection_sensitivity
number
(Optional) Face detection sensitivity.
face_detection_min_size
number
(Optional) Face detection min size.
face_detection_max_size
number
(Optional) Face detection max size.
rotation
object
(Optional) The angle of rotation to be applied to the image before analysis.
perform_construction
boolean
(Optional) Perform construction on the captured image.
frame Model Structure¶
Frame object
Name
Type
Description
data
string
Base64 encoded image. It supports JPEG image format and JPEG quality level of 90 is recommended to use to ensure expected accuracy.
tags
number
(Optional) Tag associated with the image. It can be used to include tagging information about the frame
timestamp
number
Timestamp of image with format of millisecond. The timestamp needs to be in sequential order for the frames defined in the request.
400Error Model Structure¶
Name
Type
Description
code
integer
Error code Values: -1 (Unknown Error), -2 (Invalid Input JSON), -3 (Missing Mandatory Field), -4 (Field Has Wrong Type), -5 (Invalid Base64 String), -6 (Invalid Value), -7 (Invalid Image Data), -8 (Invalid Image Size)
description
string
Error description
500Error Model Structure¶
Name
Type
Description
code
integer
Error code (see table below)
description
string
Error description
Response 500 Error Information¶
Code |
Description |
---|---|
100 |
The library failed to allocate memory. |
114 |
The profile specified was not a valid PreFace 6 profile. |
118 |
The specified minimum size is out of the range [0 1]. |
119 |
The specified maximum size is out of the range [0 1]. |
120 |
The specified minimum size is greater than the specified maximum size. |
121 |
The specified sensitivity is out of the range [0 1]. |
122 |
The specified granularity is out of the range [0 1]. |
125 |
Interframe time must be a number greater than 0. |
139 |
The image passed into the Video Library could not be parsed for analysis. |
141 |
The value for the timestamp provided was invalid. Timestamps must be greater than the previous timestamp and greater than or equal to 0.00 seconds. |
152 |
The image format specified is invalid. |
153 |
The submitted images did not all have the same width and height. |
155 |
The face detection mode specified is invalid. |
312 |
The rotation angle must be 0 90 180 or 270. |
AutoCapture Feedback¶
IMAGE_RESOLUTION_TOO_LOW - Image resolution is too low to be compliant.
NO_FACE_DETECTED - No face was detected in the image provided.
MULTIPLE_FACES_DETECTED - Multiple faces were detected in the image provided.
INVALID_POSE - The subject’s facial pose is invalid.
FACE_TOO_FAR - The subject’s face is too far from the camera.
FACE_TOO_CLOSE - The subject’s face is too close to the camera.
FACE_ON_LEFT - The subject’s face is too far to the left.
FACE_ON_RIGHT - The subject’s face is too far to the right.
FACE_TOO_HIGH - The subject’s face is too high in the frame.
FACE_TOO_LOW - The subject’s face is too low in the frame.
INSUFFICIENT_LIGHTING - The lighting is too dark.
LIGHT_TOO_BRIGHT - The lighting is too bright.
TOO_MUCH_BLUR - The camera is out of focus.
GLASSES_PRESENT - The subject is non-compliant due to the presence of eye-wear.
GLASSES_ABSENT - The subject is non-compliant due to the absence of eye-wear.
SMILE_PRESENT - The subject is non-compliant because they are smiling.
SMILE_ABSENT - The subject is non-compliant because they are not smiling.
FOREHEAD_COVERING - The subject’s forehead is covered.
BACKGROUND_TOO_CLUTTERED - The background is too cluttered.
BACKGROUND_TOO_BRIGHT - The background is too bright.
BACKGROUND_TOO_DARK - The background is too dark.
LEFT_EYE_CLOSED - The subject’s left eye is closed.
RIGHT_EYE_CLOSED - The subject’s right eye is closed.
LEFT_EYE_OBSTRUCTED - The subject’s left eye is obstructed.
RIGHT_EYE_OBSTRUCTED - The subject’s right eye is obstructed.
OFF_ANGLE_GAZE - The subject’s gaze is off angle.
HEAVY_FRAMES - The subject is non-compliant due to the thickness of their eye-wear frames.
GLARE - The frame is non-compliant due to excessive glare.
DARK_GLASSES - The subject is non-compliant due to the presence of dark glasses.
FACIAL_SHADOWING - Shadows detected on the subject’s face.
RED_EYE - Red eye detected for the subject.
UNNATURAL_LIGHTING_COLOR - An unnatural lighting color was detected in the frame.
AWARE_INTERNAL_ERROR_1 - Internal Error 1