---
title: Pull Documents V2
slug: api-marketplace/pull-documents-v2
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

The Pull Document V2 API is designed to empower individuals, organizations, and developers with the ability to seamlessly access and retrieve documents available through the Digilocker ecosystem. It works by getting the data from the issuer and adding it to the customer's Digilocker account, while also sending it back in the API response.
Refer to **[Get List of Document](https://docs.signzy.com/api-marketplace/get-list-of-documents)** API for all possible documents that you can retrieve along with their search parameters.

***

## API details

### Endpoint

:::CodeblockTabs
Production Environment

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

Production 2.0 Environment

```none
POST https://api.signzy.app/api/v3/digilocker-v2/pullDocumentsV2
```
:::

:::CodeblockTabs
UAT/Testing Environment

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

UAT/Testing 2.0 Environment

```none
POST https://api-preproduction.signzy.app/api/v3/digilocker-v2/pullDocumentsV2
```
:::

***

### 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  |
| ---------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| requestId        | String    | Unique ID allocated after the authorization in digilocker iframe.<br />This is returned as “**requestId**” in **[Create URL](https://docs.signzy.com/api-marketplace/create-url-api)** API. | Mandatory |
| docType          | String    | The type of document. Refer to **[Get list of Document](https://docs.signzy.com/api-marketplace/get-list-of-document)** API for all possible inputs.                                        | Mandatory |
| orgid            | String    | The ID of the organization that issued the document. Refer to **[Get list of Document](https://docs.signzy.com/api-marketplace/get-list-of-document)** API for orgid of each DocType.       | Mandatory |
| consent          | String    | Indicates whether consent is given to pull the document ("**Y**" for Yes, "**N**" for No).                                                                                                  | Mandatory |
| searchParameters | Object    | Contains the required Parameters for the specific Document. Refer to **[Get list of Document](https://docs.signzy.com/api-marketplace/get-list-of-document)** API.                          | Mandatory |
| \<parameter>     | String    | Each DocType has different Parameters. Refer to **[Get List of Document](https://docs.signzy.com/api-marketplace/get-list-of-document)** API for all necessary parameters of each doctype.  | Mandatory |
| getBase64Files   | Boolean   | To get base64 encoded string instead of persist URL.                                                                                                                                        | Optional  |
| getEAadhaarPdf   | Boolean   | To get getEAadhaar pdf                                                                                                                                                                      | Optional  |

```json
{
    "requestId": "6523d076a92cfa002cbb559c",
    "docType": "PANCR",
    "orgid": "001891",
    "consent": "Y",
    "searchParameters": {
        "<Parameter>": "<Parameter Value>"
    }
}
```

***

### Code samples

:::CodeblockTabs
```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/digilocker/pullDocumentsV2' \
--header 'Authorization: <Your Access Token>' \
--header 'Content-Type: application/json' \
--data '{
    "requestId": "6523eb5fdd640e15b002e0b6",
    "docType": "PANCR",
    "orgid": "001891",
    "consent": "Y",
    "getEAadhaarPdf": true,
    "searchParameters": {
        "panno": "XXXXX0000X",
        "panName": "Name" 
    }
}'
```

```nodejs
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api-preproduction.signzy.app/api/v3/digilocker/pullDocumentsV2',
  'headers': {
    'Authorization': '<Your Access Token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "requestId": "6523eb5fdd640e15b002e0b6",
    "docType": "PANCR",
    "orgid": "001891",
    "consent": "Y",
    "getEAadhaarPdf": true,
     "searchParameters": {
      "panno": "XXXXX0000X",
      "PANFullName": "Name"
    }
  })

};
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/pullDocumentsV2"

payload = json.dumps({
  "requestId": "6523eb5fdd640e15b002e0b6",
  "docType": "PANCR",
  "orgid": "001891",
  "consent": "Y",
  "getEAadhaarPdf": true,
  "searchParameters": {
    "panno": "XXXXX0000X",
    "PANFullName": "Name"
  }
})
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.signzy.app/api/v3/digilocker/pullDocumentsV2"
  method := "POST"

  payload := strings.NewReader(`{
    "requestId": "6523eb5fdd640e15b002e0b6",
    "docType": "PANCR",
    "orgid": "001891",
    "consent": "Y",
    "getEAadhaarPdf": true,
    "searchParameters": {
        "panno": "XXXXX0000X",
        "PANFullName": "Name"
    }
}`)

  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.                                                                                                                                                                   |
| result.pdf   | String    | URL to download the document in PDF format.                                                                                                                                                        |
| result.xml   | String    | URL to download the document in XML format.                                                                                                                                                        |
| result.fieId | String    | Unique ID that contains the issuer ID, DocType, and the unique Identification number of the specific document.<br />(For example: in.gov.transport-DRVLC-Driving License number of the individual) |

:::CodeblockTabs
200

```json
{
    "result": {
        "pdf": "https://files.signzy.tech/api/files/698089305/download/xxxxxxxxxxxxxx.pdf",
        "xml": "https://files.signzy.tech/api/files/698089247/download/xxxxxxxxxxxxxxx.xml",
        "fileId": "in.gov.pan-PANCR-XXXXX0000X"
    }
}
```

400

```json
// If the customer denies consent for accessing data on the digilocker screen
{
    "error": {
        "statusCode": 400,
        "name": "error",
        "message": "User denied the consent, please try again",
        "status": 400
    }
}

// If the customer clicks on “Return to Signzy” anytime during the digilocker journey
{
    "error": {
        "statusCode": 400,
        "name": "error",
        "message": "User cancelled the journey, please try again",
        "status": 400
    }
}

// Validation Error: If any mandatory parameter is missed or data type is different
{
    "error": {
        "reason": "VALIDATION_ERROR",
        "status": 400,
        "message": "\"orgid\" is required",
        "type": "Bad Request",
        "statusCode": 400,
        "name": "error"
    }
}
```

401

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

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

// You are trying to fetch details of other person
{
    "error": {
        "reason": "AUTHORIZATION_FAILED",
        "status": 401,
        "message": "User is not Authorized to fetch details of 652523835a9f9000112b1ee6",
        "type": "Unauthorized",
        "statusCode": 401,
        "name": "error"
    }
}

// User has not yet completed their journey
{
    "error": {
        "reason": "AUTH_FAIL",
        "status": 401,
        "message": "The customer has not completed their digilocker consent journey yet, please wait for sometime or create a new request.",
        "type": "Unauthorized",
        "statusCode": 401,
        "name": "error"
    }
}
```

404

```json
{
    "error": {
        "reason": "NOT_FOUND",
        "status": 404,
        "message": "RequestID not Found",
        "type": "Not Found",
        "statusCode": 404,
        "name": "error"
    }
}
```

409

```json
{
    "error": {
        "reason": "CONFLICT",
        "status": 409,
        "message": "Unable to get data from Upstream",
        "type": "Conflict",
        "statusCode": 409,
        "name": "error"
    }
}
```
:::

***

## Note

You can fetch any document and certificate listed in the Get list of documents API using this.

For example, if you want to fetch class Xth certificate of CBSE you need to pass below info with request ID:
&#x20;\{ &#x20;
  "requestId": "6523d076a92cfa002cbb559c",

   "docType": "PANCR",

   "orgid": "001891",

   "consent": "Y",

   "getEAadhaarPdf": true,
&#x20; &#x20;

&#x20;        "searchParameters": \[
&#x20;               \{
                   "rollno": "672364897",

                   "year": "2025"
&#x20;               },
&#x20;            ]
&#x20;       },

***

**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!

