---
title: Pull Documents V2 API
slug: api-marketplace/pull-documents-v2-api
description: Learn how to call the Digilocker API and retrieve documents with this comprehensive guide. Find step-by-step instructions on logging in, sending requests, and passing important parameters. Discover sample Curl commands for both preproduction and productio
createdAt: 2022-09-19T07:28:09.000Z
---

# Introduction

Digilocker provides certain documents namely  DL High school marksheet etc.This API pulls the documents from Digilocker.

## How to call the API

You will need to [login](https://docs.signzy.com/sandboxapis) or hit Create Url before sending request. You are required to pass the requestId received from the login or Create Url hit, in the request part of API along with other input Parameters.Other input parameters include docType, searchParameter, consent etc.

## API Input Guidelines

User has to make sure to pass the all the parameterName along with their correct value in the searchParameters object for every doc type.

## Sample Curl

::::Tabs
:::Tab{title="Preproduction"}
```curl
curl --location --request POST 'https://preproduction.signzy.tech/api/v2/patrons/..patronId../digilockers' \
--header 'Authorization: <token>' \
--header 'content-type: application/json' \
--data-raw '    
    {
      "task" : "pullDocumentsV2",
      "essentials": {
          "requestId": "<request Id token>",
          "docType": "<Type of the Document>",
          "orgid": "<Id of issuing agency>",
          "consent": "Y",
          "searchParameters": {
            "...parameterName...":" "
            
          }
     }
    }'
```
:::

:::Tab{title="Production"}
```curl
curl --location --request POST 'https://signzy.tech/api/v2/patrons/..patronId../digilockers' \
--header 'Authorization: <token>' \
--header 'content-type: application/json' \
--data-raw '    
    {
      "task" : "pullDocumentsV2",
      "essentials": {
          "requestId": "<request Id token>",
          "docType": "name of the Document>",
          "orgid": "<Id of issuing agency>",
          "consent": "Y",
          "searchParameters": {
            "...parameterName...":" "
            
          }
     }
    }'
```
:::
::::

### Input Parameters

| **Parameter Name&#x20;**    | **Required/Optional**  | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| --------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Authorization               | Required               | Contains the id parameter returned from the login step                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| content-type                | Required               | application/json                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| task                        | Required               | Type of task to be performed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| essentials.requestId        | Required               | RequestId token from [Create URL API.](https://docs.signzy.com/sandboxapis/create-url-api)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| essentials.docType          | Required (conditional) | DocType to be called                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| essentials.orgid            | Required (conditional) | Id of issuing agency                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| consent                     | Required (conditional) | The consent indicator from the user for sharing his Aadhaar details with the issuer for pulling the document into his/her DigiLocker. Client must capture the consent from the user. The possible values are “Y” and “N”. The client application must display following consent text to the user and capture user’s consent: I provide my consent to share my Aadhaar Number, Date of Birth and Name from my Aadhaar eKYC information with the \{\{Issuer Name}} for the purpose of fetching my \{\{Certificate Name}} into DigiLocker. The \{\{Issuer Name}} in above text will be replaced by the orgName and the \{\{Certificate Name}} will be replaced by the docDescription returned in Get List of Documents API. |
| essentials.searchParameters | Required (conditional) | Parameters required for fetching a document as listed in parameterName field in searchParameter Array of Get List of Documents API                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

### Sample Response

```json
// user has to make sure to pass the all the parameterName along with their correct value in the searchParameters object for every doc type.
// Expected response
{
"result": {
"pdf": "...direct url to download pdf...",
"xml": "...direct url to download xml..."
}
}

```

### Response Parameter

| ***Parameter Name&#x20;*** | **Description**            |
| -------------------------- | -------------------------- |
| result.pdf                 | direct url to download pdf |
| result.xml                 | direct url to download xml |

***

:::hint{type="info"}
### 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](#).
:::

