ID Scans - Redacting Fields

Learn how to redact fields from an ID Scan's documentData Object and ID Crop.


Overview

The setIDScanExtras() Method can be used to redact fields in an ID Scan's documentData Object and ID Crop. The setIDScanExtras() Method uses a JSON String with information on the fields that should be kept to modify the Original Response Blob.

The New Response Blob can then be processed with processSessionRequest() to only return a documentData Object and ID Crop with the fields that were explicitly listed. The fields that were not listed will either be redacted (for the documentData Object) or blurred (for the ID Crop).


Specifying the Fields to Keep - Document Data

Key Parameter:

listOfFieldsToKeepOnDocumentData - A string array of the field keys to return in documentData. If this array is empty, then every field will be included in documentData.

Overview:

listOfFieldsToKeepOnDocumentData is used to specify fields that should be returned after processing the Response Blob. Any field that is not included* in this array will be redacted in the final documentData JSON object.

*Important Note: The one exception to this is if No Fields are Specified. If No Fields are Specified, then every field available in documentData will be returned.

Specifying the Fields to Keep - ID Crop

Key Parameter:

listOfFieldsToKeepOnIDCrop - A string array of the field keys to return in the ID Crop. If this array is empty, then every field will be visible in the ID Crop.

Overview:

listOfFieldsToKeepOnIDCrop is used to specify fields that should be returned after processing the Response Blob. Any field that is not included* in this array will be blurred in the final image of the ID Crop.

In addition to the Regular Fields, there are two Special Fields that can be specified in listOfFieldsToKeepOnIDCrop:

  1. "signature": When this string is included in listOfFieldsToKeepOnIDCrop, the signature portion of the ID will be visible and not blurred.
  2. "face": When this string is included in listOfFieldsToKeepOnIDCrop, the facial image on the ID will be visible and not blurred.
*Important Note: The one exception to this is if No Fields are Specified. If No Fields are Specified, then every field available in the ID Crop will be visible and not blurred.

Redacting Fields with setIDScanExtras()

The setIDScanExtras() Method is used to create a New Response Blob that only returns the specified fields.

setIDScanExtras()

Uses a JSON String with listOfFieldsToKeepOnDocumentData and listOfFieldsToKeepOnIDCrop to create a New Response Blob that only returns the specified fields.

Parameters

requestBlob: String (Base64 Blob)
IDScanExtrasJSON: JSON String

Response

updatedRequestBlob: String (Base64 Blob)

Example:

// Specify the fields that will be redacted.
var idScanExtrasJSON = "{\"listOfFieldsToKeepOnDocumentData\": [\"idNumber\"], \"listOfFieldsToKeepOnIDCrop\": [\"face\", \"idNumber\"]}";
// Use the setIDScanExtras() Method to update the Request Blob with the fields to be redacted.
var updatedRequestBlob = FaceTecInstanceManager.FaceTecSDKInstance.setIDScanExtras(sessionRequest.requestBlob, idScanExtrasJSON);

// Process the Response Blob with the updated information on the fields to be redacted.
var requestResultFuture = FaceTecInstanceManager.FaceTecSDKInstance.processSessionRequest(updatedRequestBlob, new FaceTecSDKAdditionalDataCallback() {
  // ...
}