GBG Developers

Guides   |   Using the Documents Service

Using the Documents Service

This service allows for a document image (such as a passport or driving license) to be transferred from an image file or bitmap source. After the document image has been uploaded the GBG service will analyse it to perform a verification and return the result.

Here is an example using JavaScript:

function do_docCapture() {
    return window.sdkInstance.performActivity({
        activity: GBG.IDaaS.Activities.CaptureDocument
    })
	   .then((obj) => {
		console.log(obj);
	   })
        .then(() => console.log("done document capture"))
}

When run, a file selection button appears to allow the user to select the desired file to upload, or to select the camera. After the Confirm button is pressed, the document image is sent to the Identity Solution for verification.


Note that if a subsequent document page is being passed into the SDK, then a documentID parameter needs to be passed in each subsequent CaptureDocument activity. The documentID is obtained from a previous CaptureDocument activity result, extracted from the activity meta data (for the example code snippet above it would be obtained from obj.meta.documentId).

If the FaceMatch service will be used subsequently, then the verificationID needs to be stored to pass onto the FaceMatch activity. Extract it from the meta data into a variable using (say)

verification_id = obj.meta.verificationID;