Saltar al contenido principal

/civilValidation

Description

This service performs facial matching and/or data validation between the properties sent and the data from the Civil Registry.

Supported Countries

The civilValidation service supports the following countries, based on the ISO 3166-1 alpha-3 format:

  • Ecuador (ECU)
  • Costa Rica (CRI)
  • Argentina (ARG)
  • Peru (PER)
  • Guatemala (GTM)
  • Panama (PAN)
  • Honduras (HND)

Request:

curl --location '{IDENTITY_API_BASE_URL}/services/civilValidation' \
--header 'x-api-key: {API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"operation": "FULL",
"platform": "WEB",
"documentNumber": "123456789",
"imageFrontDocument": "base64ImageString",
"imageBackDocument": "base64ImageString",
"countryCode": "ARG",
"tokenOcr": "base64TokenString",
"bestImage": "base64BestImageString",
"gender": "M",
"templateRaw": "base64TemplateString",
"documentCode": "12345",
"documentValidation": true,
"returnPII": true,
"tracking": {
"extraData": "BQABAQG2gBNjuHN...",
"operationId": "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"
}
}'

Request Parameters

ParameterType (Content)RequiredDescription
operationStringYesValidation operation to perform, possible values:
  • FACIAL: Performs facial matching against the official image from the Civil Registry
  • DATA: Data validation against Civil Registry data
  • FULL: Data validation and facial matching against the Civil Registry
platformStringYesPlatform on which the request is made, possible values:
  • WEB: Request made with web widgets
  • MOBILE: Request made with mobile widgets
documentNumberStringNoUser's document number. Required if operation = FACIAL.
imageFrontDocumentString (Base64)NoFront capture of the document, base64 image without the mime type header. Required if:
  • platform = WEB
  • operation = FACIAL and documentNumber is empty
imageBackDocumentString (Base64)NoBack capture of the document, base64 image without the mime type header. Required if:
  • platform = WEB
  • operation = FACIAL and documentNumber is empty
countryCodeStringNoCountry code in ISO 3166-1 alpha-3 format. Required if:
  • platform = WEB or
  • platform = MOBILE and operation = FACIAL and documentNumber is not empty
tokenOcrString (Base64)NoToken generated by the native or hybrid SelphID widget, AES256 encrypted and tokenized, sent in Base64 format. Contains the OCR result generated from the identity document capture. Required if:
  • platform = MOBILE or
  • operation = FACIAL and documentNumber is empty
bestImageString (Base64)NoBestImage property generated by the Selphi widget. Required if:
  • operation = FACIAL or FULL and countryCode = ARG or PAN
genderStringNoGender of the individual to consult, possible values are “M” or “F”. Required if documentIssuer = ARG and documentNumber is not empty.
templateRawString (Base64)NoBiometric template, property generated by the Selphi widget. Required if:
  • operation = FACIAL or FULL
documentCodeStringNoDocument code (fingerprintCode), necessary for document validation in Ecuador. Also received as idTramite (optional) for Renaper (Argentina). Required if:
  • countryCode = ECU
documentValidationBooleanNoIndicates if document validation is to be initiated, returning scanReference and type. The documentation and exposure as a resource for document validation is found separately in the FPhi.API documentValidation specification.
returnPIIBooleanNoIndicates if personal data generated by both the OCR service and the Civil Registry response is to be received.
trackingJSON ObjectNoObject that represents necessary tracking information.
extraDataString (Base64)NoToken generated by Mobile/Web SDK. Contains tokenized tracking information with Platform.
operationIdString (Base64)NoOperation identifier generated by Mobile/Web SDK.
precaución

Depending on the integration with the Civil Registry, the use of templateRaw or bestImage may vary. For some countries and their respective integrations, it is necessary to send bestImage or templateRaw. Please check the specific requirements for each country.

Additionally, some countries require documentNumber, documentCode, and gender. Please also check these specific requirements.

Example response:

200 OK

Content-Type: application/json

{
"serviceResultCode": 0,
"serviceTime": "2812",
"serviceResultLog": "Positive | Service executed ok",
"serviceTransactionId": "81e9db11-4501-48e0-9021-d2eccc536ece",
"civilDataValidation": [
{
"field": "firstName",
"code": "0",
"message": "Validated ok"
},
{
"field": "lastName",
"code": "0",
"message": "Validated ok"
},
{
"field": "dateOfBirth",
"code": "0",
"message": "Validated ok"
}
],
"serviceFacialAuthenticationResult": 3,
"serviceFacialSimilarityResult": 0.9919787,
"serviceFacialAuthenticationHash": "309C36558C983358CEF98E811EFDA5F302023F894E2DBB66CE7BFDE56E4B4C0F28D0805C769B0C4CF7EED412EDDCC23BE7EA2637862CC634B2074DB77FA91AB5",
"serviceDocument": {
"documentNumber": "123456789",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "01/01/1980",
"gender": "M",
"nationality": "Nationality",
"dateOfExpiry": "01/01/2030",
"placeOfBirth": "Location",
"dateOfIssue": "01/01/2020",
"civilStatus": "Single"
},
"civilServiceData": {
"lastName": "Doe",
"firstName": "John",
"dateOfBirth": "01/01/1980",
"gender": "Male",
"nationality": "Nationality",
"civilStatus": "Single",
"address": "Address",
"city": "City",
"province": "Province",
"country": "Country",
"documentNumber": "123456789",
"issueDate": "01/01/2020",
"expiryDate": "01/01/2030",
"spouseName": "Spouse Name",
"motherName": "Mother Name",
"fatherName": "Father Name",
"photoUrl": "https://cdn.example.com/photo.jpeg",
"signatureUrl": "https://cdn.example.com/signature.jpeg"
}
}
nota

This is an example response for a FULL operation. The serviceDocument depends on the document modeling, and the civilServiceData depends on the response provided by the service. Some fields may or may not be present depending on the integration with the Civil Registry

Response fields:

IdentifierTypeDescription
serviceResultCodeIntegerCode indicating the overall result of the service execution. See Table 1 - Service Result Code.
serviceTimeStringField indicating the processing time.
serviceResultLogStringDescriptive field of the service execution result. Includes details when there is an error or exception in the module.
serviceTransactionIdStringTransaction identifier associated with the request processed by the API.
civilDataValidationStringObject representing the OCR validations against the data obtained from the Civil Registry. The presence of this object depends on the consulted Civil Registry.
serviceFacialAuthenticationResultIntegerCode indicating the result of the facial matching. See Table 2 - Service Facial Authentication Result.
serviceFacialAuthenticationHashStringIntegrity hash of the biometric template used in a positive or uncertain facial authentication.
serviceFacialSimilarityResultFloatValue indicating the facial similarity between the face in the identity document photo and the selfie taken by the user. 1.0 = 100%.
serviceDocumentJSONObject representing the captured document. Its properties are all the fields extracted by the OCR process.
civilServiceDataJSONObject representing the personal data obtained from the Civil Registry (returned only if returnPII was sent as true in the request).