Example Workflow¶
In this section we describe an example workflow (with CURL examples) to show how this API can be used in the "Validation" mode.
Let us suppose that the base URL of our service is: https://api.eu.veri-das.com/validas
Step 1: Initialize the validation and get the validation id¶
The first step is to initialize the validation object and get the validation Id which will be used in subsequent requests. In order to do that, we must issue a POST request to the /v1/validation endpoint. For example:
Request:
curl -X POST \ https://api.eu.veri-das.com/validas/v1/validation \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data' \
-H 'apikey: $APIKEY'
Response:
HTTP status: 201
{
"data": {
"id": "6ff8ad746169460697d149e371406425"
}
}
The service returns the new validation resource id (6ff8ad746169460697d149e371406425) which will be used in the following requests.
Step 2: Upload the document obverse image¶
The first step of the document analysis is to upload the document’s obverse image. In order to do that, we must issue a PUT request to the /v1/validation/{validation_id}/document endpoint. For example:
Request:
curl -X PUT \ https://api.eu.veri-das.com/validas/v1/validation/{validation_id}/document \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data' \
-H 'apikey: $APIKEY' \
-F 'documentImage=@my_document_obverse_image.jpeg' \
-F 'analysisType=obverse' \
-F 'serviceMode=validation' \
-F 'documentType=ES_IDCard_2015'
In this case we’re uploading an image calledmy_document_obverse_image.jpeg without a document type (the service will attempt to guess it)
Response:
HTTP status: 204
The service returns the HTTP status code 204 NO CONTENT which indicates that the analysis has gone well.
Step 4: Upload the document reverse¶
The following step of the document analysis is to upload the document’s reverse image. In order to do that, we must issue a PUT request to the /v1/validation/{validation_id}/document endpoint. For example:
Request:
curl -X PUT \ https://api.eu.veri-das.com/validas/v1/validation/{validation_id}/document \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data' \
-H 'apikey: $APIKEY' \
-F 'documentImage=@my_document_reverse_image.jpeg' \
-F 'analysisType=reverse
In this case we’re uploading an image calledmy_document_reverse_image.jpeg
Response:
HTTP status: 204
The service returns the HTTP status code 204 NO CONTENT which indicates that the analysis has gone well.
Step 5: Get document NFC configuration¶
Once the images have been uploaded, we can retrieve the NFC configuration (on compatible document types) and use the returned pins and keys to read the NFC data on the client side (using a compatible phone). In order to do that we must issue a**GET** request to the/v1/validation/{validation_id}/nfc_keys_pins endpoint:
Request:
curl -X GET \
https://api.eu.veri-das.com/validas/v1/validation/{validation_id}/nfc_keys_pins \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data' \
-H 'apikey: $APIKEY'
Response:
HTTP status: 200
{
"data": {
"nfcKeys": [
"DG1_ADDR_CITY", "DG1_ADDR_REGION", "DG11_BIRTH_PLACE", "DG2_ID_PHOTO"
],
"pinValues": [
"BDN1112233", "112233",
"870402"
]
}
}
Step 6: Upload document NFC data¶
With the NFC pins and keys values retrieved in the previous step, we can unlock and read the data contained in the NFC chip of the document. Once we have that information, we can upload it to the service by doing a PUT request to the endpoint /v1/validation/{validation_id}/nfc:
Request:
curl -X PUT \
https://api.eu.veri-das.com/validas/v1/validation/{validation_id}/nfc \ -H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data’ \
-H 'apikey: $APIKEY' \
-F 'nfcFiles=[{"fileName":"face",
"content": BASE64_FILE}]' \
-F 'nfcText={"DG1_SEX": "F",
"DG1_OPT_DATA": "987654",
"DG1_DOC_NUMBER": "99999999R",
"DG1_NATIONALITY": "ESP",
"DG11_PERS_NUM": "00ef6b6eb4474484bc41d055046fccb0", "DG1_NAME": "PEPA",
"DG1_ADDR_REGION": "MADRID",
"DG1_ADDR_CITY": "MADRID", "DG1_SURNAME": "ESPINOLA ESPINOLA", "DG1_ADDR_LINE": "AVDA DE MADRID S N", "DG1_DOB": "01 01 1980",
"DG1_DOE": "01 01 2025", "DG11_BIRTH_PLACE": "Madrid"}'
Response:
HTTP status: 204
Step 7: Upload the selfie photo¶
The first step of the face biometry analysis is to upload the selfie photo image. In order to do that, we must issue a PUT request to the /v1/validation/{validation_id}/selfie endpoint. For example:
Request:
curl -X POST \ https://api.eu.veri-das.com/validas/v1/validation/{validation_id}/selfie \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data' \
-H 'apikey: $APIKEY' \
-F 'imagemage=@my_selfie_image.jpeg'
Response:
HTTP status: 204
The service returns the HTTP status code 204 NO CONTENT which indicates that the analysis has gone well.
Step 8: Upload the selfie video¶
The second step of the face biometry analysis is to upload the selfie video. In order to do that, we must issue a PUT request to the /v1/validation/{validation_id}/video endpoint. For example:
Request:
curl -X POST \ https://api.eu.veri-das.com/validas/v1/validation/{validation_id}/video \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data' \
-H 'apikey: $APIKEY' \
-F 'video=@my_selfie_video.jpeg'
Response:
HTTP status: 204
The service returns the HTTP status code 204 NO CONTENT which indicates that the analysis has gone well.
Step 9: Get the validation results¶
The data generated by the validation process can be retrieved by issuing a GET request to the/v1/validation/{validation_id} endpoint. For example:
Request:
curl \ https://api.eu.veri-das.com/validas/v1/validation/{validation_id} \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data' \
-H 'apikey: $APIKEY'
Response:
HTTP status: 200
The service returns the HTTP status code 200 and all the data generated by vali-Das by
doing the different analysis processes.
{
"data": {
"createdAt": "2020-06-26 07:49:16 +0200",
"data": {
"biometry": {
"_links": [
{
"href": "https://api.eu.veri-das.com/validas/v1/validation/d4fafa87cdf348cd876e643595b22c8 2/selfie_d4fafa87cdf348cd876e643595b22c82_09890a9ec27751420abd.jpeg",
"rel": "image:selfie"
},
{
"href": "https://api.eu.veri-das.com/validas/v1/validation/d4fafa87cdf348cd876e643595b22c8 2/video_d4fafa87cdf348cd876e643595b22c82_b9109102a453259c86eb.flv",
"rel": "video:selfie"
}
],
"scores": [
{
"name": "ValidasScoreNfcPhotoId",
"value": 0.0743428729754
},
{
"name": "ValidasScoreSelfie",
"value": 0.00019604036154924467
}, {
"name": "ValidasScorePhotoId",
"value": 0.020908052921527406
}, {
"name": "ValidasScoreNfcSelfie",
"value": 0.00019604036154924467
}, {
"name": "ValidasScoreLifeProof",
"value": 0.9998804377574069
}, {
"name": "ValidasScoreVideoLifeProof",
"value": 0.9998804377574069
}, {
"name": "ValidasScoreVideo",
"value": 0.0070337886306746185
}
]
},
"contextualData": {},
"document": {
"_links": [
{
"href": "https://api.eu.veri-das.com/validas/v1/validation/d4fafa87cdf348cd876e643595b22c8 2/nfc_face_d4fafa87cdf348cd876e643595b22c82_1dc1419789b34b02b3af.jpeg",
"rel": "image:nfc:face"
}, {
"href": "https://api.eu.veri-das.com/validas/v1/validation/d4fafa87cdf348cd876e643595b22c8 2/reverse_d4fafa87cdf348cd876e643595b22c82_168be5eff72dac66de4d.jpeg",
"rel": "image:reverse"
}, {
"href": "https://api.eu.veri-das.com/validas/v1/validation/d4fafa87cdf348cd876e643595b22c8 2/obverse_d4fafa87cdf348cd876e643595b22c82_14ddfd343407aac151fb",
"rel": "image:obverse"
}, {
"href": "https://api.eu.veri-das.com/validas/v1/validation/d4fafa87cdf348cd876e643595b22c8 2/obverse_d4fafa87cdf348cd876e643595b22c82_14ddfd343407aac151fb_cut_face.png",
"rel": "image:face"
}, {
"href": "https://api.eu.veri-das.com/validas/v1/validation/d4fafa87cdf348cd876e643595b22c8 2/reverse_d4fafa87cdf348cd876e643595b22c82_168be5eff72dac66de4d_cut.jpeg",
"rel": "image:reverse:cut"
}, {
"href": "https://api.eu.veri-das.com/validas/v1/validation/d4fafa87cdf348cd876e643595b22c8 2/obverse_d4fafa87cdf348cd876e643595b22c82_14ddfd343407aac151fb_cut",
"rel": "image:obverse:cut"
}, {
"href": "https://api.eu.veri-das.com/validas/v1/validation/d4fafa87cdf348cd876e643595b22c8 2/obverse_d4fafa87cdf348cd876e643595b22c82_14ddfd343407aac151fb_cut_signature.png" ,
"rel": "image:signature"
}
],
"nodes": [
{
"confirmedText": "Antonio Luis",
"fieldName": "Nombre / Name",
"name": "PD_Name_Out",
"text": "PEPA"
}, {
"confirmedText": "Garcia Lozano",
"fieldName": "Apellidos / Last Names",
"name": "PD_LastName_Out",
"text": "ESPINOLA ESPINOLA"
}, {
"fieldName": "DNI / DNI",
"name": "PD_IdentificationNumber_Out",
"text": "987654"
}, {
"fieldName": "Fecha de Validez / Expiration Date",
"name": "DD_ExpirationDate_Out",
"text": "01 01 2025"
}, {
"fieldName": "Número de Soporte / Support Number",
"name": "DD_DocumentNumber_Out",
"text": "99999999R"
}, {
"fieldName": "CAN / CAN",
"name": "OD_CAN_Out",
"text": "987654"
}, {
"fieldName": "Sexo / Gender",
"name": "PD_Sex_Out",
"text": "F"
}, {
"fieldName": "Nacionalidad / Nationality",
"name": "PD_Nationality_Out",
"text": "ESP"
}, {
"fieldName": "Fecha de Nacimiento / Date of Birth",
"name": "PD_BirthDate_Out",
"text": "01 01 1980"
}, {
"fieldName": "Municipio de Nacimiento / Town of Birth ",
"name": "PD_BirthPlaceMunicipality_Out",
"text": "MADRID"
}, {
"fieldName": "Provincia de Nacimiento / Province of Birth",
"name": "PD_BirthPlaceState_Out",
"text": "MADRID"
}, {
"fieldName": "Domicilio / Address",
"name": "PD_AddressStreet_Out",
"text": "AVDA DE MADRID S N"
}, {
"fieldName": "Municipio de Domicilio / Town of Residence",
"name": "PD_AddressMunicipality_Out",
"text": "MADRID"
}, {
"fieldName": "Provincia de Domicilio / Province of Residence ",
"name": "PD_AddressState_Out",
"text": "MADRID"
}, {
"fieldName": "Padres / Parents",
"name": "OD_Parents_Out",
"text": "JUAN / CARMEN"
}
],
"scores": [
{
"name": "ValiDasMRZPaisExpedicionValue1",
"value": 1
}, {
"name": "ValiDasMRZFechaDeValidezRegular1",
"value": 1
}, {
"name": "ValiDasMRZFechaDeValidezDate2",
"value": 1
}, {
"name": "ScorePrimerApellidoOCR",
"value": 0.8333333333333334
}, {
"name": "ScoreProvinciaNacimientoOCR",
"value": 1
}, {
"name": "ScoreTotal",
"value": 0.21443352903465263
}
]
},
"integrity": {
"scores": [
{
"name": "ValidasScoreDocObverseIntegrity",
"value": 1.0
}, {
"name": "ValidasScoreDocReverseIntegrity",
"value": 1.0
}, {
"name": "ValidasScoreSelfieIntegrity",
"value": 1.0
}, {
"name": "ValidasScoreDeviceIntegrity",
"value": 1.0
}, {
"name": "ValidasScoreIntegrity",
"value": 1.0
},
]
},
"identidasVersion": "1.24.1"
},
"documentId": "20f401931c514e17aef67262d2e4f63f",
"documentType": "DNI30",
"id": "d4fafa87cdf348cd876e643595b22c82",
"pollAnswers": null,
"serviceMode": "validation",
"state": "on_course"
}
}
Step 10: Confirm the validation¶
When all the required data has been sent to vali-Das, the process comes to an end, and it has to be indicated by issuing a PUT request to the /v1/validation/{validation_id}/confirmation endpoint. For example:
Request:
curl -X PUT \ https://api.eu.veri-das.com/validas/v1/validation/{validation_id}/confirmation \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data' \
-H 'apikey: $APIKEY' \
-F 'correctedOCR=[{"name":"PD_Name_Out", "confirmedText":"Pepe Luis"}, {"name":"PD_LastName_Out", "confirmedText": "Perex Perez"}]'
Response:
HTTP status: 204
The service returns the HTTP status code 204 NO CONTENT which indicates that the request has gone well.
Note that if boi-Das is hired, once the validation is confirmed, boi-Das will download it and the validation data will be removed from VeriSaas.
Step 11: Delete the validation¶
When all the required data has been retrieved from vali-Das, validation should be deleted by issuing a DELETE request to the /v1/validation/{validation_id} endpoint. For example:
Request:
curl -X DELETE \ https://api.eu.veri-das.com/validas/v1/validation/{validation_id} \
-H 'cache-control: no-cache' \
-H 'apikey: $APIKEY' \
-H 'content-type: multipart/form-data'
Response:
HTTP status: 204
The service returns the HTTP status code 204 NO CONTENT which indicates that the request has gone well.