---
title: Pull Documents V2
slug: v3-gateway/pull-documents-v2
description: Learn how to use an API to effortlessly retrieve documents by utilizing various parameters including Org ID, Doctype, and search criteria. This comprehensive document contains sample CURL code and input parameters necessary for making the API call, alongs
createdAt: 2023-03-15T07:19:56.000Z
---

## Introduction

You can use this API to pull any of the documents by passing the value - Org ID, Doctype, search parameters, etc. To get the values of those parameters, you need to call Get List of Documents API first.

## How to call the API

You will need to log in before sending the request. You are required to pass the access token received from the login call, as the authorization header in the request.

## API Input Guidelines

Need to pass follow information. You need to make sure that your input parameter requestId is authorized before you call this API.

### Sample Curl

::::Tabs
:::Tab{title="Production"}
```curl
curl --location 'https://api.wayne-rta.com/api/v1/digilocker/pullDocumentsV2' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data '{
    "requestId": "",
    "docType": "",
    "orgid": "",
    "consent": "Y",
    "searchParameters": {
        "searchParameter1": "......",
        "searchParameter2": "......"
    }
}'
```
:::
::::

### Input Parameters

| **PARAMETERS**   | **DESCRIPTION**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | **TYPE** | **VALUE (COMPULSORY OR OPTIONAL)** |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | ---------------------------------- |
| requestId        | RequestId token                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | String   | COMPULSORY                         |
| docType          | Name of the DocType to be called                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | String   | COMPULSORY                         |
| orgid            | Id of the issuing agency                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | String   | COMPULSORY                         |
| consent          | 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. | String   | COMPULSORY                         |
| searchParameters | Parameters required for fetching a document as listed in parameterName field in searchParameter Array of Get List of Documents API                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Object   | COMPULSORY (conditional)           |

## Sample Response

:::CodeblockTabs
200

```json
{
    "result": {
        "fileId" : "...fileId...",
        "pdf": "...direct url to download pdf...",
        "xml": "...direct url to download xml..." 
    }                         
 }

```
:::

### Response Parameter

| **PARAMETERS** | **DESCRIPTION**        | **TYPE** | **VALUE** |
| -------------- | ---------------------- | -------- | --------- |
| fileId         | fileId of the document | String   |           |
| pdf            | PDF format of document | String   | URL       |
| xml            | XML format of document | String   | URL       |

## Sample Error

:::CodeblockTabs
```json
{
  "error": {
    "statusCode": "...status code...",
    "name": "error",
    "message": "....reason....",
    "status": "...status code...",
    "reason" : "",
    "type" : ""
  }
}
```

400

```json
{
    "error": {
        "reason": "BAD_REQUEST",
        "status": 400,
        "message": "INVALID requestId",
        "type": "Bad Request",
        "statusCode": 400,
        "name": "error"
    }
}
```

400

```json
{
    "error": {
        "reason": "AUTH_FAIL",
        "status": 400,
        "message": "This requestId is not authorized to perform this action.",
        "type": "Bad Request",
        "statusCode": 400,
        "name": "error"
    }
}
```

400

```json
{
    "error": {
        "reason": "VALIDATION_ERROR",
        "status": 400,
        "message": "\"docType\" is not allowed to be empty",
        "type": "Bad Request",
        "statusCode": 400,
        "name": "error"
    }
}
```

400

```json
{
    "error": {
        "reason": "VALIDATION_ERROR",
        "status": 400,
        "message": "\"orgid\" is not allowed to be empty",
        "type": "Bad Request",
        "statusCode": 400,
        "name": "error"
    }
}
```

400

```json
{
    "error": {
        "reason": "VALIDATION_ERROR",
        "status": 400,
        "message": "\"consent\" must be one of [Y, N]",
        "type": "Bad Request",
        "statusCode": 400,
        "name": "error"
    }
}
```

401

```json
{
    "message": "No API key found in request"
}
```
:::

### Error Parameter

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

### Error Codes

| **CODE** | **DESCRIPTION**                |
| -------- | ------------------------------ |
| 400      | Invalid inputs                 |
| 401      | Authorization Token is invalid |

:::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](#).
:::

