---
title: Aadhaar XML
description: Download Aadhaar XML data using OTP or file-based authentication via the BaaS API.
---

This api is for aadhar XML download. We have to pass type of Aadhaar XML Download api, aadhaarNo, otp, airpay transaction id and request id in request. If the request is valid, we will get a success response.

#### POST

```
https://kraken.airpay.co.in/airpay/ms/baas/api/aadhaar-xml
```

## Header

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| affiliate  required | Text | Will be provided by airpay | `91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps` |
| checksum  required | Text | $string = $param.self::$secret_key; | `91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps` |
| api-key  required | Text | Will be provided by airpay | `91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps` |
| processor-key  required | Text | Will be provided by airpay | `91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps` |
| live  required | Text | For live data pass Y or leave it blank | `Y` |

## Request Body

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| type  required | Text | Type of Aadhaar XML Download api. It must be 'otp' or 'file' | `file` |
| aadhaarNo  required | Text  <br>(12) | Required if the api type is set to 'otp' | `123456789012` |
| requestId  required | Text | Received from OTP API Response. Required if the api type is set to 'file'. | `91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps` |
| otp  required | Text  <br>(6) | Received from OTP API on the mobile number mapped to Aahdaar. Required if the api type is set to 'file'. | `002013` |
| airpay_txn_id  required | Text | Received from OTP API Response. Required if the api type is set to 'file'. | `428` |

## Success 200

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| status  required | Numeric | 400- fail,200-success(length 3) |
| message  required | Text | success, fail |
| For  required |  | OTP API: |
| requstId  required | Text | eg. 7c123a46-1234-4a75-880c-54a1144896b2 |
| airpay_txn_id  required | Numeric | eg. 435 |
| Data  required | Text | { "dataFromAadhaar": { "generatedDateTime": "2022-01-04 13:32:32.976", "maskedAadhaarNumber": "XXXX XXXX 9012", "name": "Rohit", "dob": "XXXX-XX-21", "gender": "M", "mobileHash": "4eSb23fb0abc37a3aa3ea04fe74457adea7badafaca51c83c958785958881873", "emailHash": null, "relativeName": null, "address": { "splitAddress": { "houseNumber": "P-6", "street": null, "landmark": "Near tyy Hotel", "subdistrict": null, "district": "Raigarh", "vtcName": "Panvel East", "location": "", "postOffice": null, "state": "Maharashtra", "country": "India", "pincode": "410200" }, "combinedAddress": "P-6,, Near tyy Hotel, Raigarh, Panvel East, Maharashtra, India, 410200" }, "image": "/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/", "maskedVID": "XXXX XXXX 9012", "file": "UEsDBBQACQAIggAFBA5FQAAAAAAAAAAAAAAAAjAAAAb2ZmbGluZWFhZGhhYXIyMDIyMDcwNDA4MDIzMjk4Mi54bWwfLd8fBLirJ2dQEu8s5Y8IjV8N7L/" }, "message": "Aadhaar XML file downloaded successfully", "shareCode": "7000"<br>} |

## Request Example For OTP API

```
 curl --location --request POST 'https://kraken.airpay.co.in/airpay/ms/baas/api/aadhaar-xml' \
--header 'api-key: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'affiliate: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'checksum: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'processor-key: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'live: Y' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'aadhaarNo=123456789012' \
--data-urlencode 'type=otp'
```

## Request Example For FILE API

```
 curl --location --request POST 'https://kraken.airpay.co.in/airpay/ms/baas/api/aadhaar-xml' \
--header 'api-key: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'affiliate: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'checksum: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'processor-key: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'live: Y' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'otp=002013' \
--data-urlencode 'requestId=91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--data-urlencode 'type=file' \
--data-urlencode 'airpay_txn_id=428'
```

### Success Response For OTP API

```
{
    "status": "200",
    "message": "success",
    "requstId": "91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps",
    "airpay_txn_id": 428
}
```

### Success Response For FILE API

```
{
    "status": "200",
    "message": "success",
    "data": {
        "dataFromAadhaar": {
            "generatedDateTime": "2022-07-04 13:32:32.976",
            "maskedAadhaarNumber": "XXXX XXXX 9012",
            "name": "Rohit",
            "dob": "XXXX-XX-21",
            "gender": "M",
            "mobileHash": "91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps",
            "emailHash": null,
            "relativeName": null,
            "address": {
                "splitAddress": {
                    "houseNumber": "P-6",
                    "street": null,
                    "landmark": "Near tyy Hotel",
                    "subdistrict": null,
                    "district": "Raigarh",
                    "vtcName": "Panvel East",
                    "location": "",
                    "postOffice": null,
                    "state": "Maharashtra",
                    "country": "India",
                    "pincode": "410200"
                },
                "combinedAddress": "P-6,, Near tyy Hotel, Raigarh, Panvel East, Maharashtra, India, 410200"
            },
            "image": "/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/",
            "maskedVID": "XXXX XXXX 9012",
            "file": "UEsDBBQACQAIggAFBA5FQAAAAAAAAAAAAAAAAjAAAAb2ZmbGluZWFhZGhhYXIyMDIyMDcwNDA4MDIzMjk4Mi54bWwfLd8fBLirJ2dQEu8s5Y8IjV8N7L/"
        },
        "message": "Aadhaar XML file downloaded successfully",
        "shareCode": "7000"
    }
}
```

### Error Response

```
{
    "status": "400",
    "message": "Failed",
    "data": ""
}
```