---
title: Passport Fetch
slug: api-marketplace/passport-fetch
createdAt: 2023-11-02T11:46:52.780Z
---

## Introduction

Passport fetch by file number API is designed to streamline the retrieval of passport information based on a unique file number. By inputting the file number, you can access pertinent information associated with the passport, ensuring a convenient and efficient process for passport verification and validation.

***

## API details

### Endpoint

:::CodeblockTabs
Production Environment

```jsx
POST https://api.signzy.app/api/v3/passport/fetches
```
:::

:::CodeblockTabs
UAT/Testing environment

```jsx
POST https://api-preproduction.signzy.app/api/v3/passport/fetches
```
:::

***

### Request headers&#x20;

| 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 parameters

| **Parameter** | **Data Type** | **Description**                                                                | **Required** |
| ------------- | ------------- | ------------------------------------------------------------------------------ | ------------ |
| fileNumber    | String        | File number. A unique identifier assigned to each Indian passport application. | Mandatory    |
| dob           | String        | Date of birth in the format **DD/MM/YYYY**                                     | Mandatory    |

```json
{
    "fileNumber": "<File number>",
    "dob": "DD/MM/YYYY"
}
```

***

### Code samples

:::CodeblockTabs
```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/passport/fetches' \
--header 'Authorization: <Your access token>' \
--header 'Content-Type: application/json' \
--data '{
    "fileNumber": "XX0000000000000",
    "dob": "DD/MM/YYYY"
}'
```

```nodejs
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api-preproduction.signzy.app/api/v3/passport/fetches',
  'headers': {
    'Authorization': '<Your access token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "fileNumber": "XX0000000000000",
    "dob": "DD/MM/YYYY"
  })

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

payload = json.dumps({
  "fileNumber": "XX0000000000000",
  "dob": "DD/MM/YYYY"
})
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-preproduction.signzy.app/api/v3/passport/fetches"
  method := "POST"

  payload := strings.NewReader(`{
    "fileNumber": "XX0000000000000",
    "dob": "DD/MM/YYYY"
}`)

  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                                                           |
| -------------------------------- | --------- | --------------------------------------------------------------------- |
| fileNumber                       | String    | File number in the request.                                           |
| dob                              | String    | Date of birth in the request. In format **DD/MM/YYYY.**               |
| id                               | Integer   | Unique ID for the request.                                            |
| result                           | Object    | Contains the passport details retrieved using the file number.        |
| result.fileNumber                | String    | File number.                                                          |
| result.givenName                 | String    | First Name of the individual.                                         |
| result.surname                   | String    | Surname of the individual.                                            |
| result.typeOfApplication         | String    | Type of application.                                                  |
| result.applicationReceivedOnDate | String    | Date when passport application was received.In format **DD/MM/YYYY.** |
| result.name                      | String    | Full name of the individual.                                          |
| result.dob                       | String    | Date of birth of the individual format **DD/MM/YYYY.**                |

:::CodeblockTabs
200

```json
{
    "result": {
        "fileNumber": "XXXXXXXXX",
        "givenName": "PRANAV RAMDAS",
        "surname": "BHAGAT",
        "typeOfApplication": "NORMAL",
        "applicationReceivedOnDate": "10/02/2020",
        "name": "PRANAV RAMDAS BHAGAT",
        "dob": "30/07/1999"
    }
}
```

400

```json
// When fileNumber is not passed in request body
{
    "error": {
        "name": "error",
        "message": "fileNumber is required",
        "status": "Bad Request",
        "statusCode": 400
    }
}

// when dob is not passed in request body
{
    "error": {
        "name": "error",
        "message": "dob is required",
        "status": "Bad Request",
        "statusCode": 400
    }
}
// when empty string is passed in fileNumber
{
    "error": {
        "name": "error",
        "message": "fileNumber is not allowed to be empty string",
        "status": "Bad Request",
        "statusCode": 400
    }
}

// When dob is passed as empty string 
{
    "error": {
        "name": "error",
        "message": "dob is not allowed to be empty string",
        "status": "Bad Request",
        "statusCode": 400
    }
}
```

401

```json
// When API key is not passed in headers
{
    "message": "No API key found in request"
}

// When wrong API key is passed in headers
{
    "message": "Invalid authentication credentials"
}
```

404

```json
// When wrong fileNumber is passed 
{
    "error": {
        "statusCode": 404,
        "name": "error",
        "message": "File No not Found",
        "status": 404
    }
}
```
:::

***

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