NAV Navbar
cURL JSON CodeSnippet

Revision History

SI# Ver# Modified By Modification Made Modification Done On
1 0.1 Tech Team Initial Draft 04/25/2019

1. Overview

The RBI's KYC Master Direction now allows the Aadhaar card to be accepted as an OVD as long as the Aadhaar number is concealed. We let you mask an Aadhaar card by hiding the Aadhaar Number, barcode and QR code present in a Aadhaar Card. These images can be stored for your KYC records to become compliant with the latest regulations.

Purpose of this document is to explain the approach and design of Aadhaar Id Masking solution. Aadhaar Id masking means, put a mask on the first 8 digits of 12 digit Aadhaar number, barcode and QR Code.

At high level, below given are the requirements that should be fulfilled by the proposed solution.

INPUT OUTPUT
One to One: Input a JPG, PNG, PDF with 1 Aadhaar Card We will return the file after masking Aadhaar Number, QR Code, barcode present in the Aadhaar Card.
One to Many: Upload one PNG, JPG, PDF file with multiple Aadhaar cards We will return the file after masking Aadhaar Number, QR Code barcode on each Aadhaar Card present in the file.
Many to Many: Bulk upload PDF, PNG, JPG files You can bulk upload files in an SFTP server. We will detect all Aadhaar cards present in every file and return the files to you after masking Aadhaar Number, QR Code, barcode on every Aadhaar Card.

Note: All text or images present in the uploaded file, except for Aadhaar Card, will remain intact.

2. Solution Approach

Proposed solution works in two modes :

Case 1 :

Solution will expose an API that will accept image of Aadhaar Card as input and respond Aadhaar Card with Aadhaar number, QR Code, Barcode masked.

Input Aadhaar Card Document can be in the following formats : JPEG, PNG, PDF with ‘n’ number of pages.

Case 2 :

Supports the capability of bulk processing Aadhaar Card data.

Solution Flow will be as follows :

3. How Clients consume the Service

Clients can consume Aadhaar Masking Service in one of the following means.

Following sections explain these solutions in detail.

3.1 API - doAadhaarNumberMask

There are two different ways to make the masking request.

3.1.1 POST request using JSON Payload

Http Method : POST
HTTP Headers : Content-Type : application/json
Input Payload : (As Raw JSON) which is defined below.
Request Payload Json :

{
  request_id : << Random generated string which should be unique per transaction >>
  client_code : << Unique code shared with the client >>
  channel_code : << MOBILE / WEB_APP / DEFAULT >>
  api_key : << Unique key shared with the client >>
  environment : << PROD / PREPROD >>
  service_code : << Service code of the API, currently “DEFAULT” >>
  documents : << List containing documents which have to masked >>
     [
      {
       “document_name” : “ “ ,
       “document_data” : “Base64 document Image”
      },
      {
       “document_name” : “ “ ,
       “document_data” : “Base64 document Image”
      }
      .
      .
      .
     ]
3.1.2 POST Request with Multipart / Form-Data

Http Method : POST
HTTP Headers : Content-Type : application/json
Input Payload : (As form data)
Request Payload :

request_id : << Random generated string which should be unique per transaction >>
client_code : << Unique code shared with the client >>
channel_code : << MOBILE / WEB_APP / DEFAULT >>
api_key : << Unique key shared with the client >>
environment : << PROD / PREPROD >>
service_code : << Service code of the API, currently “DEFAULT” >>
document_1 : << PDF / Image file attached which is to be masked >>
document_2 : << PDF / Image file attached which is to be masked >>
document_3 : << PDF / Image file attached which is to be masked >>
.....and so on.
3.1.3 API Response

status : << SUCCESS / FAIL >>
documents : << List containing documents which were processed. >>

[
{“document_data” : “Base64 document data”,
“document_name” : “”},
{“document_data” : “Base64 document data”,
“document_name” : “”},
... and so on...
]

3.2 Bulk File Input

Solution provides the capability to process bulk inputs, where in clients can upload files in bulk to mask documents.

System expects input files to be in specific folders that is accessible over SFTP. There will be scheduled jobs that will process the files present in SFTP Location and store the results back in predefined location.

Batch can run as per scheduled frequency and will process the bulk files that are uploaded by the client in the folder corresponding to that date.

For the clients to consume the service following steps has to be executed :

Client has to establish an SFTP connection to the KLs SFTP Server.

Note: Any software/SFTP client can also be used for establishing this connection.

SFTP folders

  1. INPUT

  2. RESPONSE

The client will create a folder with the name in the format clientCode_date where date is in the format dd/mm/yyyy, inside the ‘INPUT’ folder. He has to put all images (jpg/png) and pdfs to be processed that day inside this folder. The job will run daily and check the folder (if exists) for that date and process all files inside it. The masked files will be put in ‘RESPONSE’ folder inside a folder named clientCode_date.

Eg for ‘INPUT’ folder is provided below:

INPUT / dummyCode_23082019 / file_1.jpg / file_2.png / file_3.pdf

Response files naming convention for images will be as follows :

Response files naming convention for pdfs will be as follows:

file_3.pdf (masked pdf file)

file_3_DETAILS.csv (information about how many aadhaars were masked on which pages)

The structure for above csv file is: page_no, no_of_aadhaar_masked

Eg for ‘RESPONSE’ folder is provided below:

RESPONSE / dummyCode_23082019 / file_1.jpg / file_2.png / file_3.pdf / file_3_DETAILS.csv

NOTE: client code cannot have ‘_’

4. Input Image Specifications