Saltar al contenido principal

/extractDocumentData

This service returns all the data extracted from an identification document by applying OCR to MRZ code, PDF, Barcode, and visible fields in other areas of the document according to the model defined for each country.

Integration

This service is used for implementations of the SelphID Mobile widget by sending the TokenOCR property generated from the widget's native function.

Request:

curl --location '{IDENTITY_API_BASE_URL}/services/extractDocumentData' \
--header 'x-api-key: {API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"tokenOcr": "{{tokenOcr}}",
"tracking": {
"extraData": "{{extraData}}",
"operationId": "{{operationId}}"
}
}'
'

Request parameters:

ParameterType (Content)RequiredDescription
tokenOcrString (Base64)YesToken generated by the native or hybrid SelphID widget, AES256 encrypted and tokenized, sent in Base64 format. Contains the OCR result from the document capture.
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.

Example response:

200 OK

Content-Type: application/json

{
"serviceResultCode": 0,
"serviceResultLog": "Service request successfully processed",
"serviceTime": "19",
"serviceDocument": "{\"Back/BARCODE/BarcodeData\":\"ABC123\",\"Back/BARCODE/BarcodeType\":\"Code39\",\"Back/BARCODE/DocumentData\":\"ABC123\",\"Back/INPUT/Issuer\":\"USA\",\"Back/MRZ/DateOfBirth\":\"01/01/1980\",\"Back/MRZ/DateOfExpiry\":\"01/01/2030\",\"Back/MRZ/DocumentCode\":\"P\",\"Back/MRZ/DocumentData\":\"123456789\",\"Back/MRZ/DocumentNumber\":\"987654321\",\"Back/MRZ/FirstName\":\"JOHN\",\"Back/MRZ/FullName\":\"JOHN DOE\",\"Back/MRZ/Issuer\":\"USA\",\"Back/MRZ/LastName\":\"DOE\",\"Back/MRZ/MrzText\":\"P<USA123456789987654321<<<<<<<<<<<<<\n8001015<3001017USA<<<<<<<<<<<1\nDOE<<JOHN<<<<<<<<<<<<<<<<<<<<<\",\"Back/MRZ/Nationality\":\"USA\",\"Back/MRZ/NfcKey\":\"123456789\",\"Back/MRZ/Opt2\":\"300101\",\"Back/MRZ/PrimaryID\":\"DOE\",\"Back/MRZ/SecondaryID\":\"JOHN\",\"Back/MRZ/Verified\":\"YES\",\"DateOfBirth\":\"01/01/1980\",\"DateOfExpiry\":\"01/01/2030\",\"DateOfIssue\":\"01/01/2020\",\"DocumentCaptured\":\"US/v2\",\"DocumentNumber\":\"987654321\",\"FirstName\":\"JOHN\",\"Front/INPUT/Issuer\":\"USA\",\"Front/ML/DateOfBirth\":\"01/01/1980\",\"Front/ML/DateOfExpiry\":\"01/01/2030\",\"Front/ML/DateOfIssue\":\"01/01/2020\",\"Front/ML/DocumentNumber\":\"987654321\",\"Front/ML/FirstName\":\"JOHN\",\"Front/ML/LastName\":\"DOE\",\"Front/ML/Nationality\":\"USA\",\"FullName\":\"JOHN DOE\",\"Issuer\":\"USA\",\"LastName\":\"DOE\",\"MatchingSidesScore\":\"1.000\",\"Nationality\":\"USA\",\"NfcKey\":\"123456789\"}",
"serviceTransactionId": "123e4567-e89b-12d3-a456-426614174000"
}

Response fields:

IdentifierTypeDescription
serviceResultCodeIntegerCode indicating the overall result of the service execution. See Table 1 - Service Result Code
serviceTimeStringTotal execution time of the service (milliseconds).
serviceResultLogStringDescriptive field of the service execution result. Details of the module are included in case of an error or exception.
serviceTransactionIdStringTransaction identifier associated with the request processed by the API.
serviceDocumentJSONObject that represents the captured document. Its properties are all the fields extracted by the OCR process.