XML Format

The XML response can be understood in three parts as follows: i. High level response structure ii. Generic certificate structure iii. Certificate specific structure

High Level Response Structure

A description:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
  <PullDocResponse xmlns:ns2="http://tempuri.org/">
          <ResponseStatus status="1" ts="YYYY-MM-DDThh:mm:ss+/-nn:nn" txn="">
                //1-Success //0-Failure
          </ResponseStatus>
          <DocDetails>
                  <DocContent>//Base64 encoded PDF content</DocContent>
                  <DataContent>//Base64 encoded XML content of certificate data </DataContent>
          </DocDetails>
  </PullDocResponse>

Element: PullDocResponse

The enveloping XML element of the response.

Element: ResponseStatus

Contains the details about the response.

Attribute

Mandatory (M)/

Optional (O)

Description
status M 1 for success, 0 for error.
ts M A timestamp value as sent in the request.
txn M Transaction id as passed in the request.

Element: DocDetails

Issuer can add certificate data here. This is the enveloping structure for PDF and XML certificate data.

Element: DocContent

Contains the Base64 byte encoded contents of PDF file in this element.

Element: DataContent

Contains the Base64 byte encoded contents of certificate metadata in XML format. See the Generic Certificate Structure section below for more details.

Generic Certificate Structure

This section of XML file contains generic information such as issue date, expiry date of the certificate, the issuer details and issue details. This information will apply to all types of certificates available through DigiLocker. The generic certificate structure will be enveloped in DataContent element as mentioned in high level response structure as above. The generic certificate structure will be as follows:

A description:

       <?xml version="1.0" encoding="utf-8"?>
       //Certificate metadata in XML format
       <Certificate language="" name="" type="" number="" prevNumber="" issuedAt="" issueDate="" validFromDate="" expiryDate="" status="A/E/R/S">
         <IssuedBy>
               <Organization name="" code="" tin="" uid="" type="CG/SG/NG" >
                 <Address type="present/permanent/mailing/official" line1="" line2="" house="" landmark="" locality="" vtc="" district="" pin="" state="" country="" />
               </Organization>
         </IssuedBy>
         <IssuedTo>
               <Person uid="" title="" name="" dob="" age="" swd="" swdIndicator="S/W/D" motherName="" gender="M/F/T" maritalStatus="" relationWithHof="I/M/F/H/W/S/D/O"
                               disabilityStatus=""  category="" religion="" phone="" email="">
                 <Address type="present/permanent/mailing/official" line1="" line2="" house="" landmark="" locality="" vtc="" district="" pin="" state="" country="" />
                 <Photo format="RAW/PNG/JPG/JPEG">Base 64 encoded image content</Photo>
               </Person>
               <Person uid="" title="" name="" dob="" swd="" swdIndicator="S/W/D" motherName="" gender="M/F/T" maritalStatus="" disabilityStatus="" category="" religion="" phone="" email="">
                 <Address type="present/permanent/mailing/official" line1="" line2="" house="" landmark="" locality="" vtc="" district="" pin="" state="" country="" />
                 <Photo format="RAW/PNG/JPG/JPEG">Base 64 encoded image content</Photo>
               </Person>
               <Organization name="" code="" tin="" uid="" type="CG/SG/NG" >
                 <Address type="present/permanent/mailing/official" line1="" line2="" house="" landmark="" locality="" vtc="" district="" pin="" state="" country="" />
               </Organization>
         </IssuedTo>
       <CertificateData>//Other certificate specific data such as marks in case of mark list or income in case of income certificate
       </CertificateData>
       <Signature/>
</Certificate>

Element: Certificate

Contains the details about the certificate. It contains issuers details in IssuedBy element, the details about the received in IssuedTo element, certificate specific details in CertificateData element and digital signature in Signature element.

Attribute

Mandatory (M)/

Optional (O)

Description
language M The code of the language of the certificate data. The only language currently supported is English. This attribute must be set to 99.
name M The descriptive name of the certificate e.g. ‘Caste Certificate’
type M The 5 character DigiLocker document type (DOCTYPE) e.g. CTCER
number M The unique certificate number assigned by the issuer.
prevNumber O The previous certificate number associated if any.
issuedAt O The descriptive name of the place or office where the certificate is issued.
issueDate M The date of issue in DD-MM-YYYY format.
validFromDate O The date from which the certificate is valid in DD-MM-YYYY format.
expiryDate O The expiry date of the certificate in DD-MM-YYYY format.
status O

The current status of the certificate. It will be one of the following:

A – Active

E - Expired

R - Revoked/Cancelled

S – Suspended

Or any certificate specific status as provided by the certificate issuer.

The default value is Active.

Element: IssuedBy

Contains the details about the issuing authority in Organization element.

Element: Organization

Contains the details about the issuing organization.

Attribute

Mandatory (M)/

Optional (O)

Description
name M The descriptive name of the issuing authority.
code O The domain specific organization code if any.
tin O The Tax Identification Number (TIN) of the issuing authority.
uid O The unique identification number of the issuing authority.
type M

The type of the issuer. It will contain one of the following values:

CG – Central Government Organization

SG – State Government Organization

NG – Non Government Organization

Element: Address

Contains the address of the issuing organization.

type O

Type of address. It will be on of the following:

Present

Permanent

Mailing

Official

line1 M Line 1 of the address
line2 O Line 2 of the address
house O House number if any
landmark O Landmark if any
locality O Locality if any
vtc M Village, town or city
district O District
pin O PIN code
state M State
country M Country

Element: IssuedTo

Contains the details about the individual/s or the organization/s to which the certificate is issued. It contains one or more Person or Organization elements.

Element: Person

Contains the details about the individual to whom the certificate is issued. Some certificates such as marriage certificate are issued to more than one individual. In case of these certificates, more than one Person elements will be present.

Attribute

Mandatory (M)/

Optional (O)

Description
uid O The Aadhaar number of the individual.
title O Title of the individual such as Mr, Mrs, Ms, Dr.
name M The name of the individual as on the certificate.
dob O The date of birth of the individual in DD-MM-YYYY format.
age O The age of the individual.
swd O The name of the father, mother or husband.
swdIndicator O

The relationship to the individual mentioned in the swd attribute. It will be one of the following values:

S – Son

W – Wife

D – Daughter

motherName O Mother’s name
gender M

The gender of the individual. It will contain one of the following values:

M – Male

F – Female

T – Transgender

maritalStatus O

The marital status of the individual. Will have one of the following values:

1 - Never married

2 - Currently married

3 - Widow / Widower

4 - Divorced

5- Separated

relationWithHof O

Relationship of this individual with the head of the family:

I – Self

M – Mother

F – Father

H – Husband

W – Wife

S – Son

D – Daughter

O – Any other relationship

disabilityStatus O Disability status of the individual.
category O The category of the individual such as SC/ST/OBC/General
religion O

Religion of the individual. Will have one of the following values:

1 - Buddhist

2 - Christian

3 - Hindu

4 - Islam

5 - Jain

6 - Sikh

99 – Other

phone O Phone number of the individual.
email O Email address of the individual.

Element: Photo

Contains the base64 encoded content of photograph in PNG, JPG or JPEG format of the individual to whom the certificate is issued.

Attribute

Mandatory (M)/

Optional (O)

Description
format M

Format of the photograph. It will contain one of the following values:

PNG

JPG

JPEG

Element: Organization

Contains the details about the organization to which the certificate is issued. See the details of Organization element described above for attribute details.

Element: CertificateData

Contains the certificate specific details. Every certificate type will contain different elements/attributes. Please see Certificate Specific Structure for more details.

Element: Signature

The issuer will sign the XML certificate and provide the digital signature in this element for verification. This is the root element of issuer’s digital signature. This signature can be verified using issuer’s public key. The issuer will sign the contents of the Certificate element. The Signature element complies with W3C XML signature scheme. For more details, refer: http://www.w3.org/TR/xmldsig-core/

Certificate Specific Structure

This section of XML file contains specific information about the certificate. This information will be different for each type of certificate available through DigiLocker. The specific certificate structure will be as follows:

A description:

<CertificateData>
        //Other certificate specific data such as marks in case of mark list or income in case of income certificate
</CertificateData>
Element: CertificateData
Contains the certificate specific details. Every certificate type will contain different elements/attributes. The Appendix section of this document provides the XML structure for each certificate supported by DigiLocker in XML format.