---
title: Reorient Id Card
slug: v3-gateway/reorient-id-card
description: Learn how to correct the orientation of an identity card image using the Reorient ID Card API. This comprehensive document provides step-by-step instructions on calling the API, input guidelines, and sample responses. It also offers code samples in variou
createdAt: 2023-06-12T17:26:43.000Z
---

## Introduction

The Reorient Id Card API allows users to correct the orientation of an identity card image. This API is useful for ensuring that the ID card is properly aligned for further processing. This documentation provides details on how to call the API, input guidelines, sample responses, and other relevant information.

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

The Reorient Id Card API is used to correct the orientation of an identity card image. You can upload the image or provide a direct URL to the image.

### Endpoint details:

:::CodeblockTabs
Production Environment

```none
POST https://signzy.tech/api/v2/patrons/{patron-id}/utils
```
:::

:::CodeblockTabs
UAT/Testing environment

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

### Request Body Parameters

| **Parameter**  | **Data Type** | **Description**                                                                                                                                                                                                                                  | **Required** |
| -------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ |
| task           | String        | Specifies the type of task to be performed (e.g., **reOrientId**).                                                                                                                                                                               | Yes          |
| essentials.url | String        | Specifies the URL of the image to be reoriented.                                                                                                                                                                                                 | Yes          |
| essentials.ttl | String        | Expiry time for the reoriented image. Optional parameter with default value of 3 years. Accepted values include: "2 mins", "10 mins", "30 mins", "2 hrs", "12 hrs", "7 days", "15 days", "1 month", "3 months", "6 months", "1 year", "3 years". | Optional     |

:::CodeblockTabs
Input Parameter

```curl
{
  "task": "reOrientId",
  "essentials": {
    "url": "{image-URL}",
    "ttl": "{expiry-time}" // Optional parameter, default value is 3 years
  }
}

```
:::

### 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.../utils \
  --header 'Accept: */*' \
  --header 'Accept-Language: en-US,en;q=0.8' \
  --header 'Authorization: <Access-Token>' \
  --header 'content-type: application/json' \
  --data '{"task":"reOrientId","essentials":{"url":"......image url........","ttl":"...expiry times..."}}'
```

```nodejs
const axios = require('axios');
let data = JSON.stringify({
  "task": "reOrientId",
  "essentials": {
    "url": "......image url........",
    "ttl": "...expiry times..."
  }
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://signzy.tech/api/v2/patrons/...patronID.../utils',
  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": "reOrientId",
  "essentials": {
    "url": "......image url........",
    "ttl": "...expiry times..."
  }
})
headers = {
  'Accept': '*/*',
  'Accept-Language': 'en-US,en;q=0.8',
  'Authorization': '<Access-Token>',
  'content-type': 'application/json'
}
conn.request("POST", "/api/v2/patrons/...patronID.../utils", 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.../utils"
  method := "POST"

  payload := strings.NewReader(`{"task":"reOrientId","essentials":{"url":"......image url........","ttl":"...expiry times..."}}`)

  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": {
    "url": "{image-URL}",
    "ttl": "{time-string}"
  },
  "id": "{id}",
  "patronId": "{patron-ID}",
  "task": "reOrientId",
  "result": {
    "message": "successfully reoriented",
    "status": "200",
    "reOrientedCard": "{reoriented-image-URL}"
  }
}

```

### Response Parameter

| **Parameter** **Name** | **Description**                                               |
| ---------------------- | ------------------------------------------------------------- |
| **url**                | (string): URL of the original image.                          |
| **ttl**                | (string): Expiry time for the reoriented image.               |
| **id**                 | (string): Patron Id.                                          |
| **task**               | (string): Type of the task ("reOrientId").                    |
| **message**            | (string): Status message indicating successful reorientation. |
| **status**             | (string): HTTP status code ("200").                           |
| **score**              | (string): Overall quality score ranging from 0 to 1.          |
| **reOrientedCard**     | (string): URL of the reoriented image.                        |

**Note**: Please note that the maximum image size supported is 2MB.

***

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

