Reorient Id Card
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:
POST https://signzy.tech/api/v2/patrons/{patron-id}/utilsPOST https://preproduction.signzy.tech/api/v2/patrons/{patron-id}/utilsRequest 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 |
{
"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
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);
});Sample Response
{
"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
{
"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 |
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 [email protected].