> ## Documentation Index
> Fetch the complete documentation index at: https://docs.konnectnxt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch DigiLocker Data

> Fetches DigiLocker verification data including PAN and Aadhaar records based on the documents requested during profile creation

## Response Structure

The API returns verification data based on the documents that were requested during the DigiLocker profile creation. The `fetched_records` object will contain only the verification types that were initiated.

### Conditional Response Fields

| Scenario           | Response Contains                     | Description                                                              |
| ------------------ | ------------------------------------- | ------------------------------------------------------------------------ |
| **Aadhaar Only**   | `aadhaar_adv_check`                   | Only Aadhaar verification data is returned if only Aadhaar was requested |
| **PAN Only**       | `pan_adv_check`                       | Only PAN verification data is returned if only PAN was requested         |
| **Both Documents** | `pan_adv_check` + `aadhaar_adv_check` | Both verification records are returned if both documents were requested  |

### PAN Verification Fields (`pan_adv_check`)

| Field            | Type   | Description                                                                                                                          |
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| `dob`            | string | Date of birth from PAN records                                                                                                       |
| `name`           | string | Full name as per PAN                                                                                                                 |
| `gender`         | string | Gender (Male/Female)                                                                                                                 |
| `pan_number`     | string | PAN number (format: ABCDE1234F)                                                                                                      |
| `marital_status` | string | Marital status of the PAN holder                                                                                                     |
| `address`        | object | Complete address object with pin, house, line1, line2, state, country, district, landmark, locality, addr\_type, village\_town\_city |

### Aadhaar Verification Fields (`aadhaar_adv_check`)

| Field             | Type   | Description                                                                                                                 |
| ----------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| `dob`             | string | Date of birth from Aadhaar                                                                                                  |
| `name`            | string | Full name as per Aadhaar                                                                                                    |
| `gender`          | string | Gender (Male/Female)                                                                                                        |
| `aadhaar_number`  | string | Masked Aadhaar number (format: xxxxxxxx1234)                                                                                |
| `profile_picture` | string | URL to profile photo from Aadhaar                                                                                           |
| `address`         | object | Complete address object with state, street, country, pincode, district, landmark, location, postoffice, village\_town\_city |


## OpenAPI

````yaml GET /client/fetch-profile-data
openapi: 3.0.0
info:
  title: KonnectNXT API Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://bgv.konnectnxt.com/api
    description: Production
  - url: https://testbgv.konnectnxt.com/api
    description: QA
security:
  - bearerAuth: []
paths:
  /client/fetch-profile-data:
    get:
      tags:
        - DigiLocker
      summary: Fetch DigiLocker profile verification data
      description: >-
        Fetches DigiLocker verification details for a given case. Returns
        candidate basic details along with Aadhaar and PAN verification records.
      operationId: fetchProfileDataWithDigilocker
      parameters:
        - name: case
          in: query
          required: true
          description: UUID of the DigiLocker BGV case
          schema:
            type: string
            format: uuid
          example: 3dbad993-e69e-47f8-b9d3-5697df01f66
      responses:
        '200':
          description: DigiLocker profile data fetched successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DigilockerFetchSuccess'
              examples:
                Success:
                  summary: DigiLocker data fetched (PAN + Aadhaar)
                  value:
                    status: success
                    code: 200
                    message: Data fetched successfully
                    data:
                      name: John Doe
                      email: john.doe@example.com
                      phone_number: '9876543210'
                      dob: NA
                      gender: NA
                      fetched_records:
                        pan_adv_check:
                          dob: '1990-05-15'
                          name: JOHN DOE
                          gender: Male
                          pan_number: ABCDE1234F
                          marital_status: Single
                          address:
                            pin: '400001'
                            house: Flat 101
                            line1: Building Name
                            line2: Street Name
                            state: Maharashtra
                            country: India
                            district: Mumbai
                            landmark: Near Park
                            locality: Andheri
                            addr_type: Residential
                            village_town_city: Mumbai
                        aadhaar_adv_check:
                          dob: '1990-05-15'
                          name: JOHN DOE
                          gender: Male
                          aadhaar_number: xxxxxxxx8300
                          profile_picture: https://example.com/photo.jpg
                          address:
                            state: Maharashtra
                            street: Main Street
                            country: India
                            pincode: '400001'
                            district: Mumbai
                            landmark: Near Railway Station
                            location: Andheri West
                            postoffice: Andheri
                            village_town_city: Mumbai
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          description: Internal server error while fetching DigiLocker data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DigilockerInternalErrorResponse'
              examples:
                ServerError:
                  summary: Unexpected server error
                  value:
                    status: error
                    code: 500
                    message: Something went wrong while fetching data
                    data: null
components:
  schemas:
    DigilockerFetchSuccess:
      type: object
      required:
        - status
        - code
        - message
        - data
      properties:
        status:
          type: string
          example: success
        code:
          type: integer
          example: 200
        message:
          type: string
          example: Data fetched successfully
        data:
          type: object
          required:
            - name
            - email
            - phone_number
            - dob
            - gender
            - fetched_records
          properties:
            name:
              type: string
              example: Vivek
            email:
              type: string
              format: email
              example: vivek@konnectnxt.com
            phone_number:
              type: string
              example: '9876643222'
            dob:
              type: string
              example: '1995-01-01'
            gender:
              type: string
              example: M
            fetched_records:
              type: object
              description: Verification results for requested documents
              additionalProperties:
                type: object
    DigilockerInternalErrorResponse:
      type: object
      required:
        - status
        - code
        - message
        - data
      properties:
        status:
          type: string
          example: error
        code:
          type: integer
          example: 500
        message:
          type: string
          example: Something went wrong while fetching data
        data:
          nullable: true
          example: null
    Error:
      allOf:
        - $ref: '#/components/schemas/APIBaseResponse'
    APIErrorData:
      type: object
      properties:
        data:
          type: object
          nullable: true
          example: null
    APIBaseResponse:
      type: object
      required:
        - status
        - code
        - message
      properties:
        status:
          $ref: '#/components/schemas/APIStatus'
        code:
          $ref: '#/components/schemas/HTTPCode'
        message:
          $ref: '#/components/schemas/APIMessage'
    APIStatus:
      type: string
      enum:
        - success
        - error
      description: Overall status of the API
    HTTPCode:
      type: integer
      description: HTTP status code
      example: 400
    APIMessage:
      type: string
      description: Description of the response or error
      example: Invalid request parameters
  responses:
    '400':
      description: Bad Request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
          examples:
            Missing Token:
              summary: Bearer token is missing or invalid.
              value:
                status: error
                code: 401
                message: Bearer token is missing or invalid.
                data: null
            Incorrect Token Format:
              summary: Token format is incorrect
              value:
                status: error
                code: 401
                message: Token format is incorrect
                data: null
            No Admin Found:
              summary: No admin found for this request
              value:
                status: error
                code: 401
                message: No admin user found for this organization
                data: null
            Invalid API Key:
              summary: Invalid API Key
              value:
                status: error
                code: 401
                message: Invalid API key (organization ID)
                data: null
            User not Found:
              summary: User not found
              value:
                status: error
                code: 401
                message: User not found.
                data: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key issued by KonnectNXT. Pass as `Authorization: Bearer
        <your_api_key>`.

````