Request Builder for Upload functionality – GBG IDscan Documentation

Request Builder for Upload functionality

To have more customisation for upload functionality (submitDocument()), we offer RequestDocumentSend builder object.

Create an instance of RequestDocumentSend with the minimum setup:

Java

RequestDocumentSend request = new RequestDocumentSend();
// Set Credentials for Scanning
request.setCredentials("scanuser", "scanpassword").
request.setJourneyId("JourneyID");
// Set Document image.
request.setDocumentImage(DocumentImage); 

Kotlin

val request = RequestDocumentSend()
// For first request
request.setJourneyId()
// To connect journeys reuse journeyID from ResponseUpload.journeyId()
request.setJourneyId(ResponseUpload.JourneyId)
 
// Set Document image.
request.setDocumentImage(bitmap) 

Using Enterprise Service builder don’t need to specify credentials for each call, if specified it will override builder credentials.

If sending A4 Document you need to add:

Java

setSource(RequestDocumentSend.Source.A4_SCANNER) 

If you are sending un-extracted images with background (like from gallery) use

Java

setExtracted(RequestDocumentSend.Extracted.NO) 

Will return processed images from IDscan Enterprise service.

Java

setReturnImages(RequestDocumentSend.ReturnImages.YES) 

From “ResponseUpload” object assignee “journeyId”

Java

// You can set Returned key from response or generate random UUID
.setJourneyId("JourneyID"); 

If your server is set up for Face Match and required action is “SELFIE”, “LIVENESS” (FaceMatch part) or Triple scan for a selfie, you need to submit selfie image using the following:

Java

setSelfieImage(selfie); 

Token Authentication

To use an authentication token, you need to use Request builder as a base.

Java

EnterpriseService enterprise = new EnterpriseService(getApplicationContext());
enterprise.setBaseUrl("Base URL");
RequestDocumentSend requestDocumentSend = new RequestDocumentSend();
requestDocumentSend.setDocumentImage(bitmap);
requestDocumentSend.setCredentials(new Credentials("User", "Password"));
enterprise.submitDocument(requestDocumentSend, onDocumentSubmittedListener); 

Replace default username and password credentials constructor to empty one and add a setter for token.

Java

 requestDocumentSend.setCredentials(new Credentials().setToken("TOKEN")); 

Kotlin Example of adding token.

val enterpriseService = EnterpriseService.Builder(this)
                               .baseUrl(baseUrl)
                               .token("token")
                               .build() 

Android MJCS does not provide alternative token retrieval methods; please consult with your Technical Account Manager. (supportcase@idscan.com).

Was this page helpful?