Prepare the EnterpriseService object
Java
EnterpriseService enterprise = new EnterpriseService(getApplicationContext());
enterprise.setBaseUrl("base");
Kotlin supports builder pattern which allows providing credentials and base URL in EnterpriseService itself.
Kotlin
val enterpriseService = EnterpriseService.Builder(this)
.baseUrl(baseUrl)
.credentials(credentials)
.build()
Create a new journey by setting Upload credentials, setting a random journey GUID, adding an extracted document image (Smart capture or Manual Extraction results) and finally uploading to IEOS backend.
Java
// Build customisable request.
RequestDocumentSend request = new RequestDocumentSend();
request.setCredentials(SampleApplication.CREDENTIALS_UPLOAD);
request.setDocumentImage(documentImage);
// Send our request for Upload.
enterprise.submitDocument(request, mDocumentSubmittedListener);
Kotlin
val request = RequestDocumentSend()
request.setDocumentImage(bitmap)
enterpriseService?.submitDocument(request, documentSubmittedListener)
Get the required result from supplied OnDocumentSubmittedListener.
Java
responseUpload.getRequiredAction()
responseUpload.getJourneyId();
Kotlin
responseUpload.getJourneyId()
responseUpload.requiredAction
To continue journeys, we need the next required action and journey id.
Java
// Build customizable request.
RequestDocumentSend request = new RequestDocumentSend();
request.setCredentials(SampleApplication.CREDENTIALS_UPLOAD);
request.setJourneyId(responseUpload.getJourneyId()
// For Front and Back actions and their rescans.
request.setDocumentImage(documentImage);
// For Selfie and first Liveness action and their rescans replace setDocumentImage() to setSelfieImage()
request.setSelfieImage(SampleApplication.mSelfieImage);
// For Proof of address actions default setDocumentImage() and add setSource() as A4_SCANNER.
request.setDocumentImage(documentImage);
request.setSource(RequestDocumentSend.Source.A4_SCANNER);
// Send our request for Upload.
enterprise.submitDocument(request, mDocumentSubmittedListener);
Kotlin
// Build customizable request.
val request = RequestDocumentSend()
request.setJourneyId(responseUpload.getJourneyId())
// For Front and Back actions and their rescans.
request.setDocumentImage(bitmap)
// For Selfie and first Liveness action and their rescans replace setDocumentImage() to setSelfieImage()
request.setDocumentImage(bitmap)
// For Proof of address actions default setDocumentImage() and add setSource() as A4_SCANNER.
request.setDocumentImage(bitmap)
request.setSource(RequestDocumentSend.Source.A4_SCANNER)
// Send our request for Upload.
enterpriseService?.submitDocument(request, documentSubmittedListener)
enterpriseService?.submitDocument(request, documentSubmittedListener)
Liveness
For liveness refer to a section: How to send data to serve FaceMatch and Liveness:
The journey ends when the required action is “NONE”.
After the final step, you can retrieve full journey result using getJourney() call in EnterpriseService
The final journey result can be found in responseJourney.getHighLevelResultEnum();