---
title: Offline Aadhaar API (OKYC)
slug: api-marketplace/offline-aadhaar-api-okyc
description: Learn how to download and extract your Aadhaar XML file easily using the Offline Aadhaar Web API. No more manual data entry on the UIDAI website! This comprehensive guide provides step-by-step instructions, including generating an OTP and retrieving the A
createdAt: 2022-10-03T11:20:57.000Z
---

## Introduction

The Offline Aadhaar Web API will basically help the end user to enter Aadhaar number and OTP and get the Aadhaar XML file downloaded and extracted at the backend. This saves the end user from the hassle of going to the UIDAI website and entering the details manually to download the Offline Aadhaar ZIP/XML file. 

### The API will be a 2 step/API process:

1. **getOkycOtp**: Enter the Aadhaar number and generate an OTP to capture user consent
2. **fetchOkycData**: Enter the OTP and get the Aadhaar holder details

:::hint{type="info"}
**Note:**

1. Signzy API can be called using authorization token only, which needs to be procured from the respective person from Signzy side.
2. An OTP for a given Aadhaar number can be generated only once a minute. Generating an OTP for the same Aadhaar number multiple times under a minute will result in errors
3. The OTP is only valid for 540 seconds (9 minutes) after which if OTP is submitted then it will result in an error
4. If a mobile number is not linked with an Aadhaar number then this service will throw an error
5. **getOkycOtp API**
:::

## How to call the API

You must first login before sending the request. The authorization header in the request must include the access token obtained from the login API call.

## API Input Guidelines

Aadhaar Number is the Mandatory Parameter.

***

## Step 1: Getting OKYC OTP

### Sample CURL

::::Tabs
:::Tab{title="Preproduction"}
```curl
curl --location --request POST 'https://api-preproduction.signzy.app/api/v3/getOkycOtp' \
--header 'Authorization: <accessToken>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "aadhaarNumber": "<Aadhaar Number>"
}'
```
:::

:::Tab{title="Production"}
```curl
curl --location --request POST 'https://api.signzy.app/api/v3/getOkycOtp' \
--header 'Authorization: <accessToken>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "aadhaarNumber": "<Aadhaar Number>"
}'
```
:::
::::

### Input Parameters

| **Input Parameter** | **Required/Optional** | **Description**                                               |
| ------------------- | --------------------- | ------------------------------------------------------------- |
| Authorization       | Required              | Contains the id parameter returned from the login step        |
| Content-Type        | Required              | application/json                                              |
| aadhaarNumber       | Required              | Aadhaar number for data is to be extracted using ZIP/XML file |

***

### Sample Response

:::CodeblockTabs
200

```json
{
    "data": {
        "requestId": "<Request ID>",
        "otpSentStatus": true,
        "if_number": true,
        "isValidAadhaar": true
    },
    "statusCode": 200,
    "message": "OTP Sent."
}
```
:::

### Output Parameters

| **Parameters** **Name** | **Data** **Type** | **Description**                                                                                                                                           |
| ----------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| requestId               | String            | The Id which will be passed on in next API call to uniquely identify each of the request                                                                  |
| otpSentStatus           | Boolean           | True - If OTP has been sent successfullyFalse - If OTP was not sent to the end user                                                                       |
| if\_number              | Boolean           | True - If the entered “id\_number” is a numberFalse -  If the entered “id\_number” is not a number                                                        |
| isValidAadhaar          | Boolean           | True - If the entered value of “id\_number” is a valid Aadhaar card numberFalse - If the entered value of “id\_number” is not a valid Aadhaar card number |

***

## Step 2: Fetching OKYC Data

### Sample CURL

::::Tabs
:::Tab{title="Preproduction"}
```curl
curl --location --request POST 'https://api-preproduction.signzy.app/api/v3/fetchOkycData' \
--header 'Authorization: <accessToken>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "requestId": "<Request OTP>",
    "otp": "<OTP Received on Registered Mob. No.>",
    "isAadhaarMasked":"true"
}'
```
:::

:::Tab{title="Production"}
```curl
curl --location --request POST 'https://api.signzy.app/api/v3/fetchOkycData' \
--header 'Authorization: <accessToken>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "requestId": "<Request OTP>",
    "otp": "<OTP Received on Registered Mob. No.>",
    
}'
```
:::
::::

### Input Parameters

| **Input Parameter** | **Required/Optional** | **Explanation**                                                      |
| ------------------- | --------------------- | -------------------------------------------------------------------- |
| Authorization       | Required              | Contains the id parameter returned from the login step               |
| Content-Type        | Required              | application/json<br />application/json<br />application/json         |
| requestId           | Required              | ID is required to map a Generate OTP request with submit OTP request |
| otp                 | Required              | OTP sent to registered mobile number as per UIDAI records            |
| isAadhaarMasked     | Optional              | If 'true', returns masked aadhaar number                             |

### Sample Response

:::CodeblockTabs
200

```apex
{
    "data": {
        "client_id": "<Client ID>",
        "full_name": "<Name of Aadhaar Holder>",
        "aadhaar_number": "<Aadhaar Numer>",
        "dob": "1990-05-16",
        "gender": "F",
        "address": {
            "country": "<Country>",
            "dist": "<District>",
            "state": "<State>",
            "po": "<Post Office>",
            "loc": "<Locality>",
            "vtc": "<Village Town City>",
            "subdist": "",
            "street": "",
            "house": "",
            "landmark": ""
        },
        "face_status": false,
        "face_score": -1,
        "zip": "162219",
        "profile_image": "<Profile Image>",
        "has_image": true,
        "email_hash": "<Email Hash>",
        "mobile_hash": "<Mobile Hash>",
        "raw_xml": "<Link of the raw XML file>",
        "zip_data": "<Link of the ZIP file>",
        "care_of": "<Care of name in aadhaar>",
        "share_code": "",
        "mobile_verified": false,
        "reference_id": "<>",
        "aadhaar_pdf": null
    },
    "statusCode": 200,
    "message": null
}
```
:::

### Output Parameters

| Parameters Name  | Data Type | Description                                                                                         |
| ---------------- | --------- | --------------------------------------------------------------------------------------------------- |
| client\_id       | String    | The Id which was passed as an input in the above API call to uniquely identify each of the requests |
| full\_name       | String    | Full name as per Aadhaar                                                                            |
| aadhaar\_number  | String    | Aadhaar card number                                                                                 |
| dob              | String    | Date of birth as mentioned on Aadhaar                                                               |
| gender           | Enums     | Has 2 values - “M” - Male“F” - Female                                                               |
| address          | Object    | Address object                                                                                      |
| country          | String    | Country of residence as mentioned in Aadhaar                                                        |
| dist             | String    | District name of aadhaar holder                                                                     |
| state            | String    | State name of aadhaar holder                                                                        |
| po               | String    | Post office name of aadhaar holder                                                                  |
| loc              | String    | Locality name of aadhaar holder                                                                     |
| vtc              | String    | **Village Town City** name of aadhaar holder                                                        |
| subdist          | String    | Sub district name of aadhaar holder                                                                 |
| street           | String    | Street number/name of aadhaar holder                                                                |
| house            | String    | House number of aadhaar holde                                                                       |
| landmark         | String    | Landmark of aadhaar holder                                                                          |
| face\_status     | Boolean   | True /False                                                                                         |
| face\_score      | Integer   |                                                                                                     |
| zip              | String    | Zip code/Pincode of the address                                                                     |
| profile\_image   | String    | Profile image of the end user                                                                       |
| has\_image       | Boolean   | True - If there is a profile image availableFalse - If the profile image is not available           |
| email\_hash      | String    | Email Id in the hash form                                                                           |
| mobile\_hash     | String    | Mobile number in the hash form                                                                      |
| raw\_xml         | String    | Link of the raw XML file                                                                            |
| zip\_data        | String    | Link of the ZIP file downloaded                                                                     |
| care\_of         | String    | Care of field available in the address                                                              |
| share\_code      | String    | 4 digit code which should be used to open the protected ZIP file                                    |
| mobile\_verified | Boolean   | True -False -                                                                                       |
| reference\_id    | String    | Reference id available in the Aadhaar XML file                                                      |
| aadhaar\_pdf     | Null      |                                                                                                     |

## Sample Error

:::CodeblockTabs
400

```json
{
  "error": {
    "statusCode": 400,
    "name": "Error",
    "message": "\"url\" must be a valid uri",
    "status": 400
  }
}
```

400

```json
{
  "error": {
    "statusCode": 400,
    "name": "Error",
    "message": "Invalid url in essentials",
    "status": 400
  }
}
```

400

```json
{
  "error": {
    "statusCode": 400,
    "name": "Error",
    "message": "Could not process this request, please recheck parameters and try another one.",
    "status": 400
  }
}
```

400

```json
{
  "error": {
    "statusCode": 400,
    "name": "Error",
    "message": "Supplied file is not encrypted or encryption not supported",
    "status": 400
  }
}
```

400

```json
{
  "error": {
    "statusCode": 400,
    "name": "Error",
    "message": "Mobile number is not valid",
    "status": 400
  }
}
```

400

```json
{
  "error": {
    "statusCode": 400,
    "name": "Error",
    "message": "Could not parse Aadhaar XML",
    "status": 400
  }
}
```

400

```json
{
  "error": {
    "statusCode": 400,
    "name": "Error",
    "message": "Unsupported Media type",
    "status": 400
  }
}
```

401

```json
{
    "message": "Invalid authentication credentials"
}
```

409

```json
{
   "error": {
       "name": "error",
       "message": "Error in getting data",
       "status": 409,
       "reason": "CONFLICT",
       "type": "Conflict",
       "statusCode": 409
   }
}
```

500

```json
{
    "error": {
        "name": "error",
        "message": "Internal Server Error",
        "status": 500,
        "reason": "ERROR",
        "type": "Error",
        "statusCode": 500
    }
}
```
:::

### Error Parameter

| **PARAMETER NAME** | **DESCRIPTION**                    |
| ------------------ | ---------------------------------- |
| error              | This parameter contains the error. |
| error.statusCode   | Request Status code from Signzy    |
| error.name         | the name of the error              |
| error.message      | the error message                  |
| error.status       | status of the api                  |
| error.reason       | Reason for error                   |
| error.type         | Type of the error                  |

### Error Codes

| **CODE** | **DESCRIPTION**       | **INTERPRETATION**                                |
| -------- | --------------------- | ------------------------------------------------- |
| 400      | Bad Request           | Input Parameter has a missing required parameter  |
| 401      | Authorization Failed  | Authorization token is invalid.                   |
| 409      | Upstream Error        | Upstream is down, please contact support          |
| 500      | Internal Server Error | Internal error at Signzy, please contact support. |



:::hint{type="success"}
### Getting help

Please feel free to contact us if you have any questions, require clarification, or have ideas for how to make the documents or any of our services better.


You can reach out to us at [help@signzy.com](#).
:::

