Digilocker

Digilocker is an initiative under Digital India Program which aims to remove the dependency on physical documents and power the sharing of verified electronic documents across authorised agencies.

Benefits of Digilocker

  1. Documents can be shared online, accessed anytime, anywhere.
  2. Documents can be authenticated by the users, legally on a par with originals.
  3. It's simple to use and very convenient.
  4. Documents are issued directly by the registered issuers such as Income Tax Department, CBSE, Registrar Office, etc.

Product Flow

Integrate Digilocker via Decentro to fetch multiple documents in a simple flow mentioned below -

  • Initiate Session: This API initiates a session with Digilocker which will help in getting the access token.
  • Get User Access Token: This API allows the platform to get user access token from Digilocker by passing the authorization code generated from Digilocker.
  • Get Issued Files: This API allows the platform to fetch a list of issued documents from Digilocker.
  • Download e-Aadhar: This API allows the platform to download the Aadhaar XML from Digilocker.
  • Download File: This API allows the platform to download the file from Digilocker by passing the uri for a particular document.

1) Initiate Session

To access files in Digilocker, we need to initiate a session with Digilocker. Two supported parameters to start a session with Digilocker are -

  1. Aadhaar Number
  2. Mobile Number

Then we need to verify by entering the OTP in Access Token API along with Decentro Intiation Transaction ID from Initiate Session API.

Parameter Description

Parameter

Description

user_id

A valid phone number/aadhaar number with which Digilocker is associated

consent

true/false based on if your customer has given you the consent for validating his KYC based on this. Mandatory as per regulation

consent_purpose

The purpose of taking this consent from your customer. Mandatory as per regulation

reference_id

Any unique ID assigned by you for this API request

{
    "user_id": "XXXXXXXXX",
    "consent": true,
    "consent_purpose": "for banking purpose only",
    "reference_id": "11111111111"
}
{
    "decentroTxnId": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "status": "SUCCESS",
    "responseCode": "S00007",
    "message": "DigiLocker has sent you an OTP to your registered mobile (xxxxxxxxxx)"
}

2) Get User Access Token

Get access token API is used to get authorization code from Digilocker by entering the OTP received on the registered mobile number.

Parameter Description

Parameter

Description

initial_decentro_transaction_id

A Unique decentroTxnId received in the response of Initiate Session API

otp

An OTP received on your registered mobile number on Digilocker from Initiate Session API

consent

true/false based on if your customer has given you the consent for validating his KYC based on this. Mandatory as per regulation

consent_purpose

The purpose of taking this consent from your customer. Mandatory as per regulation

reference_id

Any unique ID assigned by you for this API request

{
    "initial_decentro_transaction_id": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "otp": "111111",
    "consent": true,
    "consent_purpose": "for banking purpose only",
    "reference_id": "11111111111"
}
{
    "decentroTxnId": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "status": "SUCCESS",
    "responseCode": "S00007",
    "message": "Access Token generated successfully from Digilocker",
    "data": {
        "accessToken": "XXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "refreshToken": "XXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "expiresIn": 3600,
        "digilockerId": "XXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "name": "John Doe",
        "dob": "DD-MM-YYYY",
        "gender": "M",
        "eaadhaar": "Y"
    }
}

3) Get Issued Files

Get issued files API will fetch the list of issued documents in Digilocker.

Parameter Description

Parameter

Description

initial_decentro_transaction_id

A unique ID assigned by Decentro when the session was initiated in Get Access Token

consent

true/false based on if your customer has given you the consent for validating his KYC based on this. Mandatory as per regulation

consent_purpose

The purpose of taking this consent from your customer. Mandatory as per regulation

reference_id

Any unique ID assigned by you for this API request

{
    "initial_decentro_transaction_id": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "consent": true,
    "consent_purpose": "for banking purpose only",
    "reference_id": "{{$randomUUID}}"
}
{
    "decentroTxnId": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "status": "SUCCESS",
    "responseCode": "S00000",
    "message": "Issued files received successfully from Digilocker",
    "data": [
        {
            "name": "Aadhaar Card",
            "type": "file",
            "size": "",
            "date": "DD-MM-YYYY",
            "parent": "",
            "mime": [
                "application/pdf"
            ],
            "uri": "in.gov.uidai-XXXXXXXXXXXXXXXXXXXXXXX",
            "doctype": "ADHAR",
            "description": "Aadhaar Card",
            "issuerid": "in.gov.uidai",
            "issuer": "Aadhaar, Unique Identification Authority of India"
        }
    ]
}

4) Get e-Aadhaar

Get e-Aadhaar API will return e-Aadhaar data in XML format.

Parameter Description

Parameter

Description

initial_decentro_transaction_id

A unique ID assigned by Decentro when the session was initiated in Get Access Token

consent

true/false based on if your customer has given you the consent for validating his KYC based on this. Mandatory as per regulation

consent_purpose

The purpose of taking this consent from your customer. Mandatory as per regulation

reference_id

Any unique ID assigned by you for this API request

{
    "initial_decentro_transaction_id": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "consent": true,
    "consent_purpose": "for banking purpose only",
    "reference_id": "{{$randomUUID}}"
}
{
    "decentroTxnId": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "status": "SUCCESS",
    "responseCode": "S00000",
    "message": "E-Aadhaar information received successfully from Digilocker",
    "data": {
        "aadhaarReferenceNumber": "",
        "proofOfIdentity": {
            "dob": "DD-MM-YYYY",
            "hashedEmail": "",
            "gender": "M",
            "hashedMobileNumber": "",
            "name": "John Doe"
        },
        "proofOfAddress": {
            "careOf": "",
            "country": "India",
            "district": "Bengaluru",
            "house": "XXX",
            "landmark": "",
            "locality": "",
            "pincode": "XXXXXX",
            "postOffice": "",
            "state": "Karnataka",
            "street": "",
            "subDistrict": "",
            "vtc": "XXXXXXXXXXXXXXXXXXXXXXXX"
        },
        "image": "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
}

5) Download File

Download file API will download a file from Digilocker from issued documents.

Parameter Description

Parameter

Description

initial_decentro_transaction_id

A unique ID assigned by Decentro when the session was initiated in Get Access Token

file_urn

The uri of the file you want to dowload which can be found in Get Issued Files API

consent

true/false based on if your customer has given you the consent for validating his KYC based on this. Mandatory as per regulation

consent_purpose

The purpose of taking this consent from your customer. Mandatory as per regulation

reference_id

Any unique ID assigned by you for this API request

📘

Note

This API will not download e-Aadhaar. e-Aadhaar can be downloaded only via Get e-Aadhaar API.

{
    "initial_decentro_transaction_id": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "file_urn": "in.gov.uidai-XXXXXXXXXXXXXXXXXXXXXXXXX",
    "consent": true,
    "consent_purpose": "for banking purpose only",
    "reference_id": "{{$randomUUID}}"
}
{
    "decentroTxnId": "DECXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "status": "SUCCESS",
    "responseCode": "S00000",
    "message": "File fetched successfully from Digilocker",
    "data": {
        "file": <base 64>
    }
}

Did this page help you?