/v2/identity
This service performs both the liveness test validation and facial validation between the two faces, whether they are open images or tokenized parameters.
This service adapts to two types of facial validations, depending on the integrated widget:
caution
- Method 3 WEB: facial authentication between an open image and bestImageToken
- Method 5 MOBILE: facial authentication between tokenFaceImage and bestImageToken
Integration
For validation type 3, an open-format image of the front of the ID card, where the face is located, is required.
For validation type 5, it is necessary to implement the SelphID Mobile widget to generate the TokenFaceImage property.
Request:
curl --location '{IDENTITY_API_BASE_URL}/onboarding/v2/identity' \
--header 'x-api-key: {API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"token1": "/9j/4AAQSkZJRgABAQAASAB....",
"bestImageToken": "BAMBAQLNHJoWGPj...",
"method": "3"
}'
Request parameters:
| Parameter | Type (Content) | Required | Description |
|---|---|---|---|
| token1 | String (Base64) | Yes | Image used as a reference for facial comparison. It can be a base64 image or TokenFaceImage, depending on the method. |
| bestImageToken | String (Base64) | Yes | Tokenized bestImage property generated by the Selphi widget and tokenized using native function. |
| method | String | Yes | Indicates the invoked comparison method according to the following specification: - Method = “3” - Facial authentication using an open image and tokenized bestImage (Base64 & bestImageToken) - Method = “5” - Facial authentication using the token generated by the document photo crop and tokenized bestImage (tokenFaceImage & bestImageToken) |
Example response:
{
"serviceTransactionId": "2db602ee-3564-4304-af95-92a52eaae12d",
"serviceResultCode": 0,
"serviceResultLog": "[identity] Service executed ok",
"serviceTime": "2235",
"facialAuthenticationResult": 3,
"facialAuthenticationLog": "Positive",
"facialAuthenticationSimilarity": 0.99214232,
"passiveLivenessResult": 3,
"passiveLivenessLog": "Live"
}
Response fields:
| Identifier | Type | Description |
|---|---|---|
| serviceTransactionId | String | Transaction identifier associated with the API request. |
| serviceResultCode | Integer | Code indicating the overall result of the service execution. |
| serviceResultLog | String | Descriptive field of the service execution result. Provides details of errors or exceptions when they occur. |
| serviceTime | String | Field indicating the processing time (milliseconds). |
| facialAuthenticationResult | Integer | Code indicating the result of the facial matching. |
| facialAuthenticationLog | String | Descriptive field of the facial matching result. |
| facialAuthenticationSimilarity | Float | Value indicating the facial similarity between the document photo and the user-taken selfie. 1.0 = 100% |
| passiveLivenessResult | Integer | Code indicating the result of the passive liveness test. |
| passiveLivenessLog | String | Descriptive field of the passive liveness result. |