---
title: Indian ID Classification
slug: v2-apis
description: Learn how to efficiently use the Signzy API to classify Indian ID cards with this comprehensive document. Get acquainted with the necessary endpoints, request body parameters, and headers. Explore code samples in curl, Node.js, Python, and Go to assist in
createdAt: 2023-06-13T12:37:18.000Z
---

## Introduction

You need to upload an image of Indian ID card to classify. You may put direct URLs to ID cards, in case you have them.

For best results, please make sure the image you use fits tightly in camera view and is horizontally-aligned. This API also accepts direct URL to an image. Each image/pdf should be less than **2MB**.

There are two important properties to note:

- **task**- indianIdCard (only Indian ID cards are supported currently). More to be coming up soon.
- **essentials-&#x20;**&#x54;his is the property which holds data for processing.
- **files-&#x20;**&#x61;rray of images to be processed (batch processing coming soon, currently only one image at a time is allowed).

## How to call the API

Before making API requests, you need to perform a login authentication and obtain an access token. The access token should be included in the authorization header of subsequent API requests. The API endpoints and environments for different operations are provided below.

## API Input Guidelines

### Endpoint Details

:::CodeblockTabs
Production Environment

```none
POST https://signzy.tech/api/v2/patrons/..patron-id.../idclassifications
```
:::

:::CodeblockTabs
UAT/Testing environment

```none
POST https://preproduction.signzy.tech/api/v2/patrons/..patron-id.../idclassifications
```
:::

### Request Body Parameters

| **Parameter**    | **Data Type** | **Description**                                                        | **Required** |
| ---------------- | ------------- | ---------------------------------------------------------------------- | ------------ |
| task             | String        | Specifies the type of task to be performed (e.g., "**indianIdCard**"). | Yes          |
| essentials.files | String Array  | Specifies the list of URLs of the images                               | Yes          |

:::CodeblockTabs
Input Parameter

```curl
{
    "task": "indianIdCard",
    "essentials": {
        "files": [
            "..url..to..the..image.."
        ]
    }
}
```
:::

### Request Body Headers

| **Header Name** | **Required/Optional** | **DESCRIPTION**                                    |
| --------------- | --------------------- | -------------------------------------------------- |
| Authorization   | Required              | access token returned as id field of login request |
| Content-Type    | Required              | application/json                                   |

### Code Samples

:::CodeblockTabs
```curl
curl --request POST \
  --url https://signzy.tech/api/v2/patrons/...patronID.../idclassifications \
  --header 'Accept: */*' \
  --header 'Accept-Language: en-US,en;q=0.8' \
  --header 'Authorization: <Access-Token>' \
  --header 'content-type: application/json' \
  --data '{"task":"indianIdCard","essentials":{"files":["...url of the images..."]}}'
```

```nodejs
const axios = require('axios');
let data = JSON.stringify({
  "task": "indianIdCard",
  "essentials": {
    "files": [
      "...url of the images..."
    ]
  }
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://signzy.tech/api/v2/patrons/...patronID.../idclassifications',
  headers: { 
    'Accept': '*/*', 
    'Accept-Language': 'en-US,en;q=0.8', 
    'Authorization': '<Access-Token>', 
    'content-type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

```python
import http.client
import json

conn = http.client.HTTPSConnection("signzy.tech")
payload = json.dumps({
  "task": "indianIdCard",
  "essentials": {
    "files": [
      "...url of the images..."
    ]
  }
})
headers = {
  'Accept': '*/*',
  'Accept-Language': 'en-US,en;q=0.8',
  'Authorization': '<Access-Token>',
  'content-type': 'application/json'
}
conn.request("POST", "/api/v2/patrons/...patronID.../idclassifications", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://signzy.tech/api/v2/patrons/...patronID.../idclassifications"
  method := "POST"

  payload := strings.NewReader(`{"task":"indianIdCard","essentials":{"files":["...url of the images..."]}}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Accept", "*/*")
  req.Header.Add("Accept-Language", "en-US,en;q=0.8")
  req.Header.Add("Authorization", "<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))
}
```
:::

## Sample Response

```json
{
    "essentials": {
        "files": ["..url..to..the..image.."]
    },
    "id": "5babXXXXX0c6",
    "patronId": "5a905XXXXX19d8",
    "task": "indianIdCard",
    "result": [{
        "status": "success",
        "classification": {
            "status": "success",
            "idType": "aadhaar/individualPan/businessPan/unknownPan/passport/dl/voterId/cheque/unknown",
            "message": "Successfully completed."
        }
    }]
}
```

***

## Sample Error

:::CodeblockTabs
```json
{
    "error": {
        "name": "error"
        "status": "...status code...",
        "msg": "...reason...",
        "responseCode": "fail"
    }
}
```

400

```json
{
    "error": {
        "name": "Invalid Request JSON Syntax",
        "status": "400",
        "msg": "Expecting property name enclosed in double quotes: line 3 column 3 (char 155)",
        "responseCode": "fail"
    }
}
```

401

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

422

```json
{
    "error": {
        "status": "422",
        "msg": "Invalid request parameters: The image has expired",
        "responseCode": "fail"
    }
}
```
:::

***

## Status Codes

| Status Code | Description                    |
| ----------- | ------------------------------ |
| 200         | OK                             |
| 400         | Bad Request                    |
| 401         | Authorization token is invalid |
| 422         | Unprocessable Entity           |

***

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

