---
title: Get Files API
slug: api-marketplace/get-files-api
description: Learn how to access and retrieve documents from Digilocker using the Signzy Digilocker API. This comprehensive document covers everything from API call setup to authentication and input parameters. Includes a sample CURL request and detailed explanation o
createdAt: 2022-09-14T10:17:10.000Z
---

## Introduction

Signzy provides a Digilocker iframe where the user enters the Digilocker credentials and gives access to documents in Digilocker to the client.

## How to call the API

You will need to [login](https://docs.signzy.com/sandboxapis) before sending  request. You are required to pass the access token received from the login call, as authorization header in the Get Files API request.

## API Input Guidelines

- You can get requestId from the [Create URL API](https://docs.signzy.com/sandboxapis/create-url-api) and fileIds from [Get Details API](https://docs.signzy.com/sandboxapis/get-details-api).

### Sample CURL Request

::::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": "getFiles",
    "essentials": {
        "requestId": "<request ID ",
        "fileIds": [" <file id>"]
        
    }
}'
```
:::

:::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": "getFiles",
    "essentials": {
        "requestId": " ",
        "fileIds": [" "]
        
    }
}'
```
:::
::::

### 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 Tasks to be performed in Signzy System, eg: URL , GetData                                     |
| essentials               | Required              | This parameter contains the essential data for generating output.                                     |
| essentials.fileId        | Required              | Unique ID of the document from [get Details API](https://docs.signzy.com/sandboxapis/get-details-api) |
| essentials.requestId     | Required              | This parameter contains the requestId generated from                                                  |

### Sample API Response

```json
{
essentials: {
requestId: "630c5df27a490fa69e463xxx",
fileIds: [
in.gov.cbse-SPCER-51841222xxx
]
},
id: " ",
patronId: " ",
task: "getFiles",
result: {
files: [
{
name: "Class X Passing Certificate",
type: "file",
size: "",
date: "29/05/2022",
parent: "",
mime: [
application/pdf
],
doctype: "SPCER",
description: "Class X Passing Certificate",
issuerid: "in.gov.cbse",
issuer: "Central Board of Secondary Education",
id: "in.gov.cbse-SPCER-5184122xxx",
file: {
pdf: "https://persist.signzy.tech/api/files/405237821/download/77d2fa382c3c4988b85e04eabab3cf8f5254a329ce6d47b1ab893f8eb09xxxxx.pdf"
}
}
]
}
}
```

### Response Parameter

| ***Parameter Name***     | **Description**                                                  |
| ------------------------ | ---------------------------------------------------------------- |
| id                       | The access token generated during login request is held here.    |
| patronId                 | This parameter is returned as userId parameter of login request. |
| task                     | Task - getDetails.                                               |
| result                   | Actual response of the API.                                      |
| userDetails              | Details of the user.                                             |
| userDetails.digilockerid | Digilocker ID of the user.                                       |
| userDetails.name         | Name of the person.                                              |
| userDetails.dob          | Date of birth of the person.                                     |
| userDetails.gender       | Gender of the details.                                           |
| files.name               | Name of the document.                                            |
| files.type               | type of the document.                                            |
| files.size               | Size of the document.                                            |
| files.mime               | MIME type of the document (xml,pdf etc).                         |
| files.doctype            | Type of the document (ADHAR for adhaar for eg).                  |
| files.description        | Description of the document .                                    |
| files.issuerid           | ID of the issuer.                                                |
| files.issuer             | Name of the issuer of the document (UIDAI,CBSE for eg).          |
| files.id                 | Unique id of the document.                                       |



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

