---
title: Digilocker Uniquery API (New)
slug: api-marketplace/digilocker-uniquery-api-new
description: Learn how to use the Signzy API to easily create a secure URL where users can grant consent for Signzy to access and download files from Digilocker on their behalf. Our comprehensive document provides step-by-step instructions, a sample CURL request, inpu
createdAt: 2022-09-19T04:54:28.000Z
---

## Introduction

<font color="#82064a"><u>Now, fetch IDs from Digilocker in just one API request.</u> </font><u></u>

By merging the Get Details and Get Files APIs, we've simplified the process, eliminating the need for Requesters to integrate multiple APIs. Once the ID owner gives consent via the URL the requester shares, this API retrieves approved IDs, including Aadhar, PAN, DL, and more, asynchronously.&#x20;

Once ready, a callback with the URLs of approved files is sent directly to the requester's configured callback URL.&#x20;

Say goodbye to complexity and hello to efficiency with the Digilocker Uniquery API. Simplify your ID fetching journey today!&#x20;

Note: The callback URL will be configured in the Signzy gateway during onboarding, so Requesters don't have to pass it in each API request.

***

## API details

### Endpoint

:::CodeblockTabs
Production Environment

```jsx
POST https://api.signzy.app/api/v3/digilocker/docFetchConsent
```
:::

:::CodeblockTabs
UAT/Testing Environment

```jsx
POST https://api-preproduction.signzy.app/api/v3/digilocker/docFetchConsent
```
:::

***

### Request headers

| Name          | Value            | Required  | Description                                                                                                |
| ------------- | ---------------- | --------- | ---------------------------------------------------------------------------------------------------------- |
| Content-Type  | application/json | Mandatory | The type of content that the request body contains.                                                        |
| Authorization | XXXXXXXXXXXXXXX  | Mandatory | An authentication token to authorize the request. Reach out to the Signzy support team to get one created. |

***

### Request body parameter

| Parameter             | Data Type        | Description                                                                                                                                                                                                                                                                                                                                                        | Required |
| --------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- |
| signup                | Boolean          | Indicates if the signup process is enabled or not. “**true**” if signup is enabled.                                                                                                                                                                                                                                                                                | Optional |
| redirectUrl           | String           | URL to which your end customer will be redirected after providing authorization.                                                                                                                                                                                                                                                                                   | Optional |
| redirectTime          | Integer          | Time (in seconds) after which the user will be redirected.                                                                                                                                                                                                                                                                                                         | Optional |
| successRedirectUrl    | String           | URL to which the user will be redirected upon successful authorization.                                                                                                                                                                                                                                                                                            | Optional |
| successRedirectTime   | Integer          | Time (in seconds) after which the user will be redirected post-authorization.<br />By default, it is 10 seconds.                                                                                                                                                                                                                                                   | Optional |
| failureRedirectUrl    | String           | URL to which the user will be redirected if not authorized.                                                                                                                                                                                                                                                                                                        | Optional |
| failureRedirectTime   | Integer          | Time (in seconds) after which the user will be redirected if not authorized.<br />By default, it is 10 seconds.                                                                                                                                                                                                                                                    | Optional |
| logoVisible           | String           | Indicates if a logo is to be displayed or not. "**true"** if you want the logo to be displayed.                                                                                                                                                                                                                                                                    | Optional |
| logo                  | String           | URL of the logo to be displayed if logoVisible is "**true"**.                                                                                                                                                                                                                                                                                                      | Optional |
| supportEmailVisible   | String           | Indicates if a support URL  is to be displayed or not.                                                                                                                                                                                                                                                                                                             | Optional |
| supportEmail          | String           | Email of the support page or support contact, to be displayed if supportEmailVisible is "**true"**.                                                                                                                                                                                                                                                                | Optional |
| docType               | Array of strings | Documents that you want to take consent from the end customer. By default, the value of this field would be \["**PANCR**", "**ADHAR**", "**DRVLC**"]. If you have a use-case where you want consent for some other doc type then a mapping would need to be done on Digilocker's end.<br />Reach out to the Signzy support team to facilitate the process for you. | Optional |
| purpose               | String           | Defines the purpose for which the end customer is giving consent.<br />The possible input values are:<br />"**kyc"&#x20;**<br />"**verification"**<br />"**compliance"**<br />"**availing\_services"**<br />**&#x20;"educational".**                                                                                                                               | Optional |
| getScope              | Boolean          | **"true"** if you want to check what access has been given by your end customers else "**false". &#x20;**<br />If set as "**true"** then the scope information will be pushed on the callback URL.                                                                                                                                                                 | Optional |
| consentValidTill      | Integer          | The validity period of the consent.<br />Timestamp value in seconds using the UNIX(or POSIX) format and the IST time zone.<br />The Digilocker team has not enabled the refresh token workflow, hence the requestId can be used only for 1 hour after the customer provides the consent.                                                                           | Optional |
| showLoaderState       | Boolean          | Indicates if the end customer will be able to see the loader at the end of the journey. (Only when redirectUrl is provided).                                                                                                                                                                                                                                       | Optional |
| internalId            | String           | ID to track your callback.                                                                                                                                                                                                                                                                                                                                         | Optional |
| companyName           | String           | Company name to display in the title bar at the end of the journey.                                                                                                                                                                                                                                                                                                | Optional |
| favIcon               | String           | URL of the fav icon to display in the title bar at the end of the journey.                                                                                                                                                                                                                                                                                         | Optional |
| persistPassword       | String           | String for Securing Files Retrieved via Digilocker APIs with Password Protection. \[[Read more](https://docs.signzy.com/api-marketplace/securing-customer-documents-with-password-protection)]                                                                                                                                                                     | Optional |
| pinlessAuthentication | Boolean          | Use this argument to enable a seamless, **PIN-free login experience** in the Digilocker mobile flow, available exclusively through the **Wayne domain**.                                                                                                                                                                                                           | Optional |

```json
{
    "signup": true,
    "redirectUrl": "https://www.signzy.com/",
    "redirectTime": "1",
    "successRedirectUrl": "https://www.signzy.com/",
    "successRedirectTime": "5",
    "failureRedirectUrl": "https://www.signzy.com/",
    "failureRedirectTime": "5",
    "logoVisible": "true",
    "logo": "https://rise.barclays/content/dam/thinkrise-com/images/rise-stories/Signzy-16_9.full.high_quality.jpg",
    "supportEmailVisible": "true",
    "supportEmail": "support@signzy.com",
     "docType": [
        "PANCR",
        "ADHAR"
    ],
    "purpose": "kyc",
    "getScope": true,
    "consentValidTill": 1729141682,
    "showLoaderState":true,
    "internalId":"<Internal ID>",
    "companyName":"Signzy",
    "favIcon":"https://rise.barclays/content/dam/thinkrise-com/images/rise-stories/Signzy-16_9.full.high_quality.jpg",
    "persistPassword": ""
}
```

***

### Code samples

:::CodeblockTabs
```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/digilocker/docFetchConsent' \
--header 'Authorization: <Your access token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "signup": true,
    "redirectUrl": "https://www.signzy.com/",
    "redirectTime": "1",
    "successRedirectUrl": "https://www.signzy.com/",
    "successRedirectTime": "5",
    "failureRedirectUrl": "https://www.signzy.com/",
    "failureRedirectTime": "5",
    "logoVisible": "true",
    "logo": "",
    "supportEmailVisible": "true",
    "supportEmail": "support@signzy.com",
     "docType": [
        "PANCR",
        "ADHAR"
    ],
    "purpose": "kyc",
    "getScope": true,
    "consentValidTill": 1729141682,
    "showLoaderState":true,
    "internalId":"<Internal ID>",
    "companyName":"Signzy",
    "favIcon":""
}'
```

```nodejs
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api-preproduction.signzy.app/api/v3/digilocker/docFetchConsent',
  'headers': {
    'Authorization': '<Your access token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "signup": true,
    "redirectUrl": "https://www.signzy.com/",
    "redirectTime": "1",
    "successRedirectUrl": "https://www.signzy.com/",
    "successRedirectTime": "5",
    "failureRedirectUrl": "https://www.signzy.com/",
    "failureRedirectTime": "5",
    "logoVisible": "true",
    "logo": "",
    "supportEmailVisible": "true",
    "supportEmail": "support@signzy.com",
    "docType": [
      "PANCR",
      "ADHAR"
    ],
    "purpose": "kyc",
    "getScope": true,
    "consentValidTill": 1729141682,
    "showLoaderState": true,
    "internalId": "<Internal ID>",
    "companyName": "Signzy",
    "favIcon": ""
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

```

```python
import requests
import json

url = "https://api-preproduction.signzy.app/api/v3/digilocker/docFetchConsent"

payload = json.dumps({
  "signup": True,
  "redirectUrl": "https://www.signzy.com/",
  "redirectTime": "1",
  "successRedirectUrl": "https://www.signzy.com/",
  "successRedirectTime": "5",
  "failureRedirectUrl": "https://www.signzy.com/",
  "failureRedirectTime": "5",
  "logoVisible": "true",
  "logo": "",
  "supportEmailVisible": "true",
  "supportEmail": "support@signzy.com",
  "docType": [
    "PANCR",
    "ADHAR"
  ],
  "purpose": "kyc",
  "getScope": True,
  "consentValidTill": 1729141682,
  "showLoaderState": True,
  "internalId": "<Internal ID>",
  "companyName": "Signzy",
  "favIcon": ""
})
headers = {
  'Authorization': '<Your access token>',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api-preproduction.signzy.app/api/v3/digilocker/docFetchConsent"
  method := "POST"

  payload := strings.NewReader(`{
    "signup": true,
    "redirectUrl": "https://www.signzy.com/",
    "redirectTime": "1",
    "successRedirectUrl": "https://www.signzy.com/",
    "successRedirectTime": "5",
    "failureRedirectUrl": "https://www.signzy.com/",
    "failureRedirectTime": "5",
    "logoVisible": "true",
    "logo": "",
    "supportEmailVisible": "true",
    "supportEmail": "support@signzy.com",
     "docType": [
        "PANCR",
        "ADHAR"
    ],
    "purpose": "kyc",
    "getScope": true,
    "consentValidTill": 1729141682,
    "showLoaderState":true,
    "internalId":"<Internal ID>",
    "companyName":"Signzy",
    "favIcon":""
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "<Your Access token>")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```
:::

***

### Response body parameters

| Parameter        | Data Type | Description                                                       |
| ---------------- | --------- | ----------------------------------------------------------------- |
| result           | Object    | Contains the result of the task being performed.                  |
| result.url       | String    | The URL to complete the authentication.                           |
| result.requestId | String    | Unique ID allocated after the authorization in digilocker iframe. |

:::CodeblockTabs
200

```json
{
    "result": {
        "url": "https://api.digitallocker.gov.in/public/oauth2/1/authorize?client_id=3DF9D55E&code_challenge=2R4H2pVG-SmhvTDn0xQlLcPWqAvp15XUufUBbQ0Sd2I&code_challenge_method=S256&dl_flow=signup&redirect_uri=https%3A%2F%2Fdigilocker.signzy.tech%2Fdigilocker-auth-complete&response_type=code&state=652d08105aac750011ff8a71",
        "requestId": "652d08105aac750011ff8a71"
    }
}
```

400

```json
// Validation error: If the parameter's data type is incorrect or value is invalid
{
    "error": {
        "reason": "VALIDATION_ERROR",
        "status": 400,
        "message": "<Message>", // example: "\"supportEmailVisible\" must be one of [true, false]"
        "type": "Bad Request",
        "statusCode": 400,
        "name": "error"
    }
}

// Passing callbackURL in request body
{
   "error": {
       "reason": "VALIDATION_ERROR",
       "status": 400,
       "message": "\"callbackUrl\" is not allowed",
       "type": "BAD_REQUEST",
       "statusCode": 400,
       "name": "error"
   }
}

// No callback URL is configured at Signzy's end
{
   "error": {
       "name": "VALIDATION_ERROR",
       "message": "No callback URL is configured",
       "status": 400,
       "reason": "VALIDATION_ERROR",
       "type": "Bad Request",
       "statusCode": 400
   }
}

```

401

```json
// If Authorization token is not passed
{
    "message": "No API key found in request"
}

// If Authorization token is invalid
{
    "message": "Invalid authentication credentials"
}
```

500

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

***

**Contact Us for Any Assistance**

If you have any questions or need assistance, please reach out to our customer support team. You can contact us via email at <font color="#2166ae">**help\@signzy.com**</font>. We strive to provide prompt and reliable assistance, ensuring your queries are addressed effectively.

We value your feedback and are committed to making your experience smooth and enjoyable. Our team is dedicated to assisting you with any needs you may have. Thank you for choosing our services. We look forward to helping you!

