---
title: Fetch API
slug: v2/fetch-api
description: Learn how to use the Indian passport API to retrieve comprehensive details of Indian passport holders. This document guides you through step-by-step instructions on calling the API, providing sample cURL commands for both pre-production and production env
createdAt: 2022-09-15T07:43:09.000Z
---

## Introduction

This API is used to fetch the details of Indian passport holders

## How to call the API&#x20;

Before going for  Verification calls, you first need to create an Identity object. Need to pass accessToken and itemid obtained from identity call along with other input parameters.

## API Input Guidelines

Need to put File Number and Date of Birth as input.

## Step 1: Hit Identities API

### Sample cURL

::::Tabs
:::Tab{title="Preproduction"}
```curl
curl --location --request POST 'https://preproduction.signzy.tech/api/v2/patrons/..patronId../identities' \
--header 'Authorization: <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "passport",
    "email": "<email Id>",
    "callbackUrl": "<call back Url>",
    "images": [
        "<Front Image Url> ",
        "<Back Image Url> "
    ]
}'
```
:::

:::Tab{title="Production"}
```curl
curl --location --request POST 'https://signzy.tech/api/v2/patrons/..patronId../identities' \
--header 'Authorization: <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "passport",
    "email": "<email Id>",
    "callbackUrl": "<call back Url>",
    "images": [
        "<Front Image Url>",
        "<Back Image Url>"
    ]
}'
```
:::
::::

### Input Parameters

| **Parameter Name** | **Required/Optional** | **Description**                                        |
| ------------------ | --------------------- | ------------------------------------------------------ |
| Authorization      | Required              | Contains the id parameter returned from the login step |
| Content-Type       | Required              | application/json                                       |
| type               | Required              | Type of identity                                       |
| email              | Required              | e-mail ID                                              |
| callbackurl        | Required              | URL where response will be posted                      |
| images             | Required              | Front and back image of passport                       |

***

### Sample Response&#x20;

```json
{
    "type": "passport",
    "email": "ankur.rand@signzy.com",
    "callbackUrl": "",
    "images": [
        "image1.jpg",
        "image2.jpg"
    ],
    "accessToken": "",
    "autoRecognition": [],
    "verification": [],
    "forgeryCheck": [],
    "id": "",
    "patronId": ""
}
```

### Response Parameter

| **Parameter Name** | **Description**                                              |
| ------------------ | ------------------------------------------------------------ |
| type               | Type of identity<br />Type of identity<br />Type of identity |
| email              | e-mail ID                                                    |
| callbackurl        | URL where response will be posted                            |
| images             | Front and back image of passport                             |
| accessToken        | This is provided by identities API                           |
| autoRecognition    | Auto recognises text from upload image                       |
| verification       | verification is done                                         |
| forgeryCheck       | Forgery check is done                                        |
| id                 | Unique user id                                               |
| patronId           | Unique patron id                                             |



## Step 2: Hit Snoops API and receives a response

### Sample cURL

::::Tabs
:::Tab{title="Preproduction"}
```curl
curl --location --request POST 'https://preproduction.signzy.tech/api/v2/snoops' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.8' \
--header 'content-type: application/json' \
--data-raw '{
    "service": "Identity",
    "itemId": "",
    "accessToken": "",
    "task": "fetch",
    "essentials": {
        "fileNumber": "",
        "dob": ""
    }
}'
```
:::

:::Tab{title="Production"}
```curl
curl --location --request POST 'https://preproduction.signzy.tech/api/v2/snoops' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.8' \
--header 'content-type: application/json' \
--data-raw '{
    "service": "Identity",
    "itemId": "",
    "accessToken": "",
    "task": "fetch",
    "essentials": {
        "fileNumber": "",
        "dob": ""
    }
}'
```
:::
::::

### Input Parameters

| **Parameter Name**    | **Required/Optional** | **Description**                                                                                      |
| --------------------- | --------------------- | ---------------------------------------------------------------------------------------------------- |
| content-type          | Required              | application/json                                                                                     |
| service               | Required              | Type of Signzy service - “identity extraction”                                                       |
| itemId                | Required              | Contains the identity item id                                                                        |
| accessToken           | Required              | This is provided by the identities API                                                               |
| task                  | Required              | The type of task performed - “Auto Recognition”<br />The type of task performed - “Auto Recognition” |
| essentials            | Required              | Contains the essential output data                                                                   |
| essentials.fileNumber | Required              | Contains file number of the passport                                                                 |
| essentials.dob        | Required              | contains the date of birth                                                                           |

### Sample API Response

```json
{
    "service": "Identity",
    "itemId": "",
    "task": "fetch",
    "essentials": {
        "fileNumber": "",
        "dob": "",
        "instance": {
            "id": "",
            "callbackUrl": ""
        }
    },
    "accessToken": "",
    "id": "",
    "response": {
        "fileNumber": "",
        "dob": "",
        "id": 227,
        "instance": {
            "id": "",
            "callbackUrl": ""
        },
        "result": {
            "fileNumber": "",
            "givenName": "",
            "surname": "",
            "typeOfApplication": "",
            "applicationReceivedOnDate": "",
            "name": "",
            "dob": ""
        }
    }
}
  
    
```

### Output Parameters

| **Parameter Name**                        | **Description**                                                                         |
| ----------------------------------------- | --------------------------------------------------------------------------------------- |
| service                                   | Type of Signzy service - “identity extraction”                                          |
| itemId                                    | Contains the identity item id                                                           |
| task                                      | The type of task performed - “Auto Recognition”                                         |
| essentials.fileNumber                     | Contains file number of the passport                                                    |
| essentials.dob                            | Contains date of the birth of the passport holder                                       |
| essentials.instance.id                    | Contains identity id                                                                    |
| essentials.instance.callbackUrl           | URL where response will be posted                                                       |
| response.result.fileNumber                | Contains file number of the passport holder                                             |
| response.result.givenName                 | Contain the name of the passport holder                                                 |
| response.result.surname                   | Contain the surname of the passport holder<br />Contain the name of the passport holder |
| response.result.typeOfApplication         | Shows the application type                                                              |
| response.result.applicationReceivedOnDate | Contains the date on which passport is applied                                          |
| response.result.name                      | Contains the name of the applicant                                                      |
| response.result.dob                       | Contains date of birth of the applicant                                                 |

###

:::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](mailto\:help@signzy.com).
:::
